title: Printing a linked list in C++ (C++98)
body: <p>I'm attempting to print the nodes in a linked list (forwards direction).
  It's defined as follows:</p>
  
  <pre><code>struct Node {
    string val;
    Node* next;
    Node* prev;
  };
  
  struct Stew {
    Node* first;
    Node* last;
  };
  </code></pre>
  
  <p>Where Stew has two special pointers, one pointing to the first element, and one to the last.</p>
  
  <p>I'm positive that what I attempted is correct, but it's actually not. </p>
  
  <pre><code>void print (const Stew&amp; q, char direction) {
    assert (!isEmpty(q));
   {
      Node* current = new Node;
  
      current = q.first;
      cout &lt;&lt; current -&gt; val;
  
      while((current -&gt; next) != NULL)
      {
          current = current -&gt; next;
          cout &lt;&lt; (current -&gt; val);
      }
      delete current;
  }
  </code></pre>
  
  <p>I know there's a logic mistake in there, but I can't seem to pinpoint it. Any help would be appreciated.</p>