🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
1 messages
1 total messages Started by kevin reilly Fri, 08 Jun 1990 20:54
float addresses in char pointers?
#661
Author: kevin reilly
Date: Fri, 08 Jun 1990 20:54
25 lines
1190 bytes
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.
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