self contained pointers to structures
Andrew Koenig
ark at alice.UUCP
Tue Nov 28 01:14:05 AEST 1989
In article <10350 at attctc.Dallas.TX.US>, bobc at attctc.Dallas.TX.US (Bob Calbridge) writes:
> I tried to implement it like this:
> struct event {
> int timing:
> int count;
> struct event *next;
> };
> Of course, the compiler complains because the definition of the structure is
> incomplete at that point.
If your compiler rejects this, it's badly broken.
There's nothing wrong with declaring a pointer to an (as yet)
unknown structure.
--
--Andrew Koenig
ark at europa.att.com
More information about the Comp.lang.c
mailing list