title: Error with Push_back function for a LinkedList?
body: <p>So, I've been working on a linked list pushback, and every time, I get some weird output, can someone help see what I'm doing wrong?  </p>
  
  <pre><code>void IntList::push_back(int ne) {
  if(head == NULL)
      tail = head = new IntNode(ne);
  
  IntNode *nes = new IntNode(ne);
  IntNode *remp = head;
  while (remp-&gt;next != NULL)
      remp = remp-&gt;next;
  remp-&gt;next = nes;
  }
  </code></pre>
  
  <p>I've been getting some weird outputs, my calls are </p>
  
  <pre><code>IntList a;
  a.push_back(46);
  a.push_back(20);
  a.push_back(777);
  a.select_sort();
  a.insert_sorted(800);
  a.display();
  cout &lt;&lt; endl;
  </code></pre>
  
  <p>and it outputs 20 46 46 777 800</p>