Pointer Problems

Gaurang Hirpara gh1r+ at andrew.cmu.edu
Tue Aug 14 03:43:19 AEST 1990



Here's a problem which has been bugging me for a while now:

Ok. I have a struct, call it idiot, with some elements in it, nothing unusual.

Now, I have another struct, which contains in it a generic 
pointer (i.e. Ptr <pointername>). 
How can I make <pointername> point to idiot, AND be able to access the 
resulting pointer as a pointer to struct. My main problem is that even
if I do manage to get them to point to the same place (which is a problem
all by itself), I can't access the internal members of the struct. 

Any ideas?

~dan



More information about the Comp.lang.c mailing list