I have a couple of header files, which boil down to:
tree.h:
#include "element.h"
typedef struct tree_
{
struct *tree_ first_child;
struct *tree_ next_sibling;
int tag;
element *obj;
....
} tree;
and element.h:
#include "tree.h"
typedef struct element_
{
tree *tree_parent;
char *name;
...
} element;
The problem is that they both reference each other, so tree needs element to be included, and element needs tree to be included.
This doesn't work because to define the 'tree' structure, the element structure must be already known, but to define the element structure, the tree structure must be known.
How to resolve these types of loops (I think this may have something to do with 'forward declaration'?)?