title: C header file loops
body: <p>I have a couple of header files, which boil down to:</p>
  
  <p>tree.h:</p>
  
  <pre><code>#include "element.h"
  
  typedef struct tree_
  {
      struct *tree_ first_child;
      struct *tree_ next_sibling;
      int tag;
      element *obj;
      ....
  } tree;
  </code></pre>
  
  <p>and element.h:</p>
  
  <pre><code>#include "tree.h"
  
  typedef struct element_
  {
      tree *tree_parent;
      char *name;
      ...
  } element;
  </code></pre>
  
  <p>The problem is that they both reference each other, so tree needs element to be included, and element needs tree to be included.</p>
  
  <p>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.</p>
  
  <p>How to resolve these types of loops (I think this may have something to do with 'forward declaration'?)?</p>