title: Display linked list inline
body: <p>I am trying to display linked list elements inline instead of having it in a new line.</p>
  
  <p>I originally thought because I had <code>/n</code> and <code>endl</code> it was displaying in a new line, so I removed them and they still display in a new line.</p>
  
  <pre><code>// display function
      void display()
      {
          Node*current = head;
  
          while (current != NULL)
          {
              cout &lt;&lt; "Queue";
              cout &lt;&lt; current-&gt;value &lt;&lt; " ";
              cout &lt;&lt; endl;
              current = current-&gt;next;
          }
  
  
      }
  
  // adding to queue function
  void enqueue(int num) {
  
          Node *node = new Node(num);
          cout &lt;&lt; "Pushing: " &lt;&lt; num &lt;&lt; endl;
          if (tail != NULL)
          {
              tail-&gt;next = node;
          }
          tail = node;
          if (head == NULL)
          {
              head = node;
          }
          display();
  
      }
  </code></pre>
  
  <p>Every time I push something to the queue it will display the value that is being pushed, and what is currently being stored in the queue.
  What is being printed every time I push something</p>
  
  <pre><code>// Results
  Pushing 1
  Queue: 1
  Pushing 2 
  Queue: 2
  Pushing 3
  Queue: 3
  
  // What I want to display
  Pushing 1
  Queue: 1
  Pushing 2
  Queue: 1 2
  Pushing 3
  Queue: 1 2 3
  
  </code></pre>