delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/23/18:46:10

From: "Bart Alewijnse" <scarfman AT geocities DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Dereferencing a void pointer
Date: 23 Jun 1999 22:02:41 GMT
Organization: WorldOnline News server
Lines: 19
Message-ID: <01bebdc4$9b2e6020$LocalHost@scarfboy.tip.nl>
NNTP-Posting-Host: vp178-201.worldonline.nl
X-Trace: news.worldonline.nl 930175361 28990 195.241.178.201 (23 Jun 1999 22:02:41 GMT)
X-Complaints-To: abuse AT worldonline DOT nl
NNTP-Posting-Date: 23 Jun 1999 22:02:41 GMT
X-Newsreader: Microsoft Internet News 4.70.1155
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have a struct with a 'void *data' member, of which the type I assign when
I
judge what data goes in it. The compiler yaks at me when I try to offset it
like:

 to->data[offset]=0;

which is of course correct. My guess is since I if my way into assigning
the
type, this is no assurance it gets assigned at all. While I catch this for
myself
with IF to->data==NULL 's and retruns, gcc isn't happy with it. However, I
know
that there IS data, what size, and all that, and I like to access it on a
byte (or
any) level.
 I probably want to cast my way into solving this. But how?

-Bart

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019