Thread View: comp.sys.ibm.pc.programmer
1 messages
1 total messages
Started by kevin reilly
Tue, 12 Jun 1990 16:43
re: casting float addres into a character pointer
Author: kevin reilly
Date: Tue, 12 Jun 1990 16:43
Date: Tue, 12 Jun 1990 16:43
15 lines
923 bytes
923 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads