Pointer Problems
Gaurang Hirpara
gh1r+ at andrew.cmu.edu
Fri Aug 17 00:38:29 AEST 1990
I got a variety of solutions, but perhaps I didn't state the problem clearly.
The form ((StructName *)Something)->x=100 works.
However, the format I need is this type:
TopLevel->Secondary->Something->x=100;
i.e. I can't do the casting in the middle of the dereference. It won't let
me no matter which way I do it. Toplevel contains a pointer to
Secondary, which contains Something. Something initially points to a
void *.
I want to be able to make it point to, say a struct StructName which has
as one of its elements x, and be able to change that element. However,
if I allocate space for Something by casting to StructName, it still has
problems getting to x.
Hope this makes the problem clearer.
~dan
"Yes suh! The 'yarth (i.e. Earth) is flat! Says so the Psalms, about the
four corners of the 'yarth. Now how you suppose a round thing has four
corners suh?"
--unknown Fundamentalist to Clarence Darrow, Scopes Trial
*****************************************************************************
* Gaurang Hirpara | gh1r at andrew.cmu.edu | Starwatcher *
* "Dan" to English speakers | ncrx at drycas.club.cc.cmu.edu| Con Artist *
* Writer, Dreamer, Spy... | r746gh1r at vb.cc.cmu.edu | -------------- *
*****************************************************************************
More information about the Comp.lang.c
mailing list