title: C adding node to head of linked list
body: <p>I have created a linked list struct in c </p>
  
  <pre><code>struct node{
     int value;
     struct node* next;
  };
  </code></pre>
  
  <p>a method to add a node at the start of the list :</p>
  
  <pre><code>void addFirst(struct node *list, int value){
      struct node *new_node = (struct node*) malloc (sizeof (struct node));
      new_node-&gt;value = value;
      new_node-&gt;next = list;
      list = new_node;
     }
  </code></pre>
  
  <p>I create a list (malloc and everything), then call this method, it adds the new node inside the method but when i get back to my main my old list remains unchanged. Using DDD debugger to check everything. How is this possible? I am not able to change the method signature so it has to be done like this.</p>