title: compiler error - dereferencing pointer to incomplete type In C programming
body: <p>Can you explain this error for me?</p>
  
  <p>In my A.h file:</p>
  
  <pre><code>struct TreeNode;
  struct TreeHead;
  typedef struct TreeNode * Node;
  typedef struct TreeHead * Head;
  </code></pre>
  
  <p>In my A.c file:</p>
  
  <pre><code>struct TreeNode {
      char* theData;
      Node Left;
      Node Right;
  } ;
  
  struct TreeHead{
      int counter;
      char type;
      Node Root;
  };
  
  Head Initialisation() {
      Head treeHead;
      treeHead = malloc(sizeof (struct TreeHead));
      treeHead-&gt;Root = malloc(sizeof (struct TreeNode));
      return treeHead;
  }
  </code></pre>
  
  <p>In my Main.c file:</p>
  
  <pre><code>Head head;
  Node tree;
  int choose =5;
  head = Initialisation(); 
  (head-&gt;Root) = tree; //When compiling, this line has an error: error: dereferencing pointer to incomplete type
  </code></pre>
  
  <p>haed->Root will return a Node pointer, tree is also a Node pointer. So why error is dereferencing pointer to "incomplete" type?</p>