title: C++ List_tail_remove debug
body: <p>I'm not how to debug this one function of my code, When I remove and output my linked list it gives me a funky decimal. Any help would be appreciated.</p>
  
  <pre><code>void list_tail_remove(node*&amp; head_ptr)
  {
      if (head_ptr == NULL)
      {
          cout &lt;&lt; "Error:The Double linked List was never Created" &lt;&lt; endl;
      }
      else
      {
          node* current = head_ptr;
          while (current-&gt;link() != NULL)
          {
              current = current-&gt;link();
          }
  
          node* temp;
          for (temp = head_ptr; temp != current; temp = temp-&gt;link())
          {
              temp = temp-&gt;link();
          }
          temp-&gt;set_link(NULL);
          delete temp;
      }
  }
  </code></pre>