Mail Archives: djgpp/1998/11/14/16:30:28
Wouter Bijlsma wrote:
>
> Hi,
>
> How can I define a recursive structure without getting parse errors or
> 'incomplete data type' errors?
>
> typedef struct {
> unsigned Tag;
> Plane *RootPlane;
> BSPNode *FrontNode,BackNode;
> Polygon *Polygons;
> } BSPNode;
>
> This does *not* work....
Use the structure tag. An example (with names that are easier to type
:) :
typedef struct foo_struct {
int other;
struct foo_struct *next;
} foo;
Note that `foo' and `struct foo_struct' are now interchangable. I'm not
sure offhand whether it would be legal to replace `foo_struct' with
plain `foo'. comp.lang.c would be a good place to ask (would have been
a good place to ask this in the first place...)
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -