title: C - linked list cannot convert node** to node*
body: <p>I was studying linked lists and copying my examiners notes exactly and couldn't get it to work. The error says that I </p>
  
  <blockquote>
    <p>cannot convert 'node**' to node*'. </p>
  </blockquote>
  
  <p>I have tried changing the types so that they match but that just causes it to crash once I run it. If someone could give me some insight into why this is happening it would be much appreciated.    </p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  
  
  struct node
  {
      int number;
      struct node *next;
  }*head;
  
  main(){
      int i;
  
      node *n1, *n2, *temp;
  
      temp = n1;
  
      n1-&gt;number = 1;
      n1-&gt;next = &amp;n2;
  
      n2-&gt;number = 2;
      n2-&gt;next = NULL;
  
  
  
     return 0;
  </code></pre>
  
  <p>}</p>