🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #661

float addresses in char pointers?

#661
From: 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.
Technical Details
Message-ID: <1920@bnlux0.bnl.gov>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!mailrus!sharkey!bnlux0!reilly

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!mailrus!sharkey!bnlux0!reilly
From: reilly@bnlux0.bnl.gov (kevin reilly)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: float addresses in char pointers?
Keywords: pointer address
Message-ID: <1920@bnlux0.bnl.gov>
Date: 8 Jun 90 20:54:36 GMT
Organization: Brookhaven National Lab
Lines: 25