title: C error dereferencing pointer to incomplete type linked list dic
body: <p>Hi guys I've had a look at the other questions with similar issues but couldn't find anything similar. I'm getting an error (as per title) in line 69 of my code and I'm not sure how to fix it. My code doesn't compile atm. This program is meant to take in keyvalue pairs and form a sorted dictionary linked list.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  typedef struct
  {
    int key;
    char value[256];
    struct node *next;
  } node;
  
  void findloc(int key, node*headnode);
  void insert(node*newinserte, node*previous, node*after);
  
  int main()
  {
    makedic();
  }
  
  int makedic()
  {
    int keydata, once;
    int compareval = 0;
    int i = 0;
    char valuedata[256];
    node * root, *head, *tmp;
    head = NULL;
    while (scanf("%d %s", &amp;keydata, &amp;valuedata) != EOF)
    {
      root = (node*) malloc(sizeof(node));
      root-&gt;key = keydata;
      strcpy(root-&gt;value, value data);
      root-&gt;next = head;
      head = root;
      if (head != NULL &amp;&amp; once == 0)
      {
        tmp = head;
        once++;
      }
      findloc(root-&gt;key, tmp);
    }
    /*for(; p1-&gt;next!=NULL;p1 = p1-&gt;next)
     {
     for (p2 = p1-&gt;next;p2!=NULL;p2=p2-&gt;next)
     {
     if(p1-&gt;key&gt;p2-&gt;key)
     {
     int temp = p1 -&gt;key;
     p1 -&gt;key = p2-&gt;key;
     p2 -&gt;key =temp;
     compareval = compareval +1;
     }
     }
     }*/
    //root = root -&gt; next;  
    while (root)
    {
      printf("%d %s\n", root-&gt;key, root-&gt;value);
      root = root-&gt;next;
    }
    printf("%d\n", compareval);
  }
  
  void findloc(int keysearch, node*headnode)
  {
    int i;
    node*head, *root;
    head = headnode;
    while (headnode-&gt;next != NULL )
    {
  /*line 69*/    if (keysearch &lt; headnode-&gt;next-&gt;key) //error is here
      {
        if (keysearch &gt; headnode-&gt;key)
        {
          //insert(headnode ,headnode-&gt;next,headnode-&gt;next-&gt;next );
        }
      }
    }
  }
  
  void insert(node*newinserte, node*previous, node*after)
  {
    int tmp = after;
    previous-&gt;next = newinserte;
    newinserte-&gt;next = tmp;
  }
  </code></pre>