why p->member ?

Ashok Rathi ash at a.cs.okstate.edu
Sat Aug 6 05:08:09 AEST 1988



"p.member" will be interpreted as "p" being the name of the structure and
"member" being the element of that structure. While "p->member" will be 
interpreted as "p" being the pointer to the structure and "member" being 
the structure itself or the element of the structure. In one case, "p" is
the structure and in another a pointer to the structure. Compiler must know
what is what since it has to allocate the space accordingly.



More information about the Comp.unix.questions mailing list