Thursday, July 9, 2009

How can i define two mutually referencing structures in c.?

typedef struct _Node


{


struct _Containter *parent;


struct _Node *next;


struct _Node *prev;


char *Data;


} Node;





typedef struct _Container


{


struct _Node *parent;


struct _Container *next;


struct _Container *prev;


struct _Node *children;


char *Data;


} Container;





In the above example, A Node structure references a Container structure and a Container structure references a Node structure.


No comments:

Post a Comment