[comp.sys.ibm.pc.programmer] casting float addres into a character pointer

reilly@bnlux0.bnl.gov (kevin reilly) (06/12/90)

Thanks to all who submitted responses to my query on storing a float
address into a character pointer. All repondents but one suggested the
following:
charPt = (char *)&float;
Which does indeed work. QC2.5 no longer gives an error message.
One respondent I don't remember who suggested using a union, which works
and is much more elegant and useful for what I have to do:
union {
char c[2];
int number;
}
You can access the high or low bytes of an arbitrary integer by looking
at c[1] and c[0].

Once Again thanks to all who responded.