title: How do I join two linked lists in C?
body: <p>I'm wanting to complete two linked lists in preparation for an exam
  here is what I have so far
  1 - reverse the elements in a linked list
  2 - append list2 to the end of list one</p>
  
  <p>I got help with the reverse function off someone in my course and have tried to comment out each step to understand what is going on but I am struggling. If you could also help me out with that it would be fantasticcaalll</p>
  
  <p>In the combine function I am just confused overall
  When do I use '&amp;' and when do I use '*'?</p>
  
  <pre><code>typedef struct node *list;
  
  typedef struct node {
      int   value;
      list  whateverNextIsCalled;
  } node;
  
  // Reverse list
  list reverse (list inputList){
      list outputList = NULL;
  
      while (inputList != NULL) {
  
         /*
          nodePtr points to the first element in the inputList
          */
          node *nodePtr = inputList;
  
         /* 
          Make the head pointer of inputList point to the next element
          */
          inputList = inputList-&gt;whateverNextIsCalled;
  
         /*
          ???? help point 1
          */
          nodePtr-&gt;whateverNextIsCalled = outputList;
  
         /*
          ???? help point 2
          */
          outputList = nodePtr;
      }
      return outputList;
  }
  
  // Add one list to the end of another
  void combine (list list1, list list2){
  
     /*
      Point to the first value of list1 
      */
      node *current = list1;
  
     /*
      Find the last node of list1
      */
      while(current-&gt;whateverNextIsCalled != NULL) {
          current = current-&gt;whateverNextIsCalled;
      }
      //connect the last node of toList and the first node of fromList
      current-&gt;whateverNextIsCalled = &amp;list2;
  
      list1 = current;
  }    
  </code></pre>