Struct definition in MS-C

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Aug 22 05:35:52 AEST 1989


In article <1575 at dsacg3.UUCP> nts0302 at dsacg3.UUCP (Bob Fisher) writes:
>I doubt it.  struct node cannot include itself in its own definition.

Recursive declarations are prohibited, but it is perfectly legitimate
to include a pointer to the same structure as one of its members.  The
structure tag is in scope, and since all structure pointers smell
alike, the compiler should have no difficulty in dealing with this
common case (which is much like examples used in K&R and other good
C programming textbooks).  The C Standard requires that this usage be
supported.

>Try swapping the last two lines like this.

Thereby producing something totally unusable for his purposes??



More information about the Comp.lang.c mailing list