title: Linked List pop() function
body: <p>Consider the following list:</p>
  
  <blockquote>
    <p>[LinkNode * head -- LinkNode * node1 -- LinkNode * node2]</p>
  </blockquote>
  
  <p>I'm creating a stack of FIFO.
  I Call pop() which I want to pop node1.  </p>
  
  <pre><code>LinkNode::LinkNode(int numIn) {
      this-&gt;numIn = numIn;
      next = null;
  }
  .
  .
  .
  int LinkNode::pop() {
      Link * temp = head-&gt;next;
      head = temp-&gt;next;
      int popped = head-&gt;nodeNum;
      delete temp;
      Return numOut;
  </code></pre>
  
  <p>Question:<br>
  1) head should be a pointer or a LinkNode *?<br>
  2) Link * temp is created on the call stack and when pop finishes doesn't temp delete automatically?<br>
  3) My major confusion is on what is the value of temp->next?  Does this point to node1.next which equals node2?  </p>
  
  <p>Appreciate your help?</p>
  
  <p>My reference is C++ for Java Programmers by Weiss.</p>