title: How to add an element to the end of a pointer list given head only?
body: <pre><code>void add_end(node** head, node* new_node)
  {
      if(*head==NULL)
      {
          *head=new_node;
          new_node-&gt;next=NULL;
      }else
      {
  
      }
  }
  </code></pre>
  
  <p>I'm new to C and pointer operation. So if I want to add an element to the end of the list, how could I manage it? I have tried <code>node *temp=*head;</code> to save the address of head without changing it. Then <code>while(temp) { temp=temp-&gt;next}</code>. Apparently, temp only get a shallow copy. How could I implement this function. Thank you.  </p>