[comp.sys.ibm.pc.programmer] float addresses in char pointers?

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

Hello to all in Netland.
I have old code compiled with QuickC 2.0 that will now not compile in
QuickC 2.5.
The portion of code that causes an error has to do with storing the
address of an integer in a character pointer.
It goes something like this:
char *charPt;
char charArray[2];
int number;

charPt = &number;
charArray[0] = *charPt;
charArray[1] = *(charPt+1);

In this way I have been able to obatin the high and low bytes of an
integer.
The reason I have even come across this is I use an digital
oscil.loscope that transfers the data as two bytes per integer.

The new QC2.5 informs me the above "charPt = &number" is an error and
won't compile it. I know it is not an example of good programming but it
worked before.

If anyone out there has any suggestions please let me know or post it.
Thank you for your time.