Date: Wed, 4 Mar 1998 17:18:35 -0800 (PST) Message-Id: <199803050118.RAA12570@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: rwh AT worldonline DOT nl, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: struct in struct Precedence: bulk At 11:02 3/4/1998 +0100, Reinier Heeres wrote: >Hi! > >How can I define a structure that should look something like this: > >typedef struct { > int a,b,c; > test *children[4]; > } test; For self-referential structures, you must use the struct tag. Like this: typedef struct t { int a, b, c; struct t *children[4]; } test; Now struct t foo; is the same as test foo; For additional obscurity, the `t' above can be changed to `test', so the struct tag and the typedef name can be the same. Btw, this would have been better posted to a comp.lang.c group. Nate Eldredge eldredge AT ap DOT net