title: Linked List outputs 1 too many?
body: <p>I'm making a singly linked list and I'm making an add to beginning node. Whenever I run my tester it works, but it adds (what I assume) an extra node at the beginning with the address.</p>
  
  <p>tester:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "linkedlist.h"
  
  using namespace std;
  
  void test01() {
  
    LinkedList &lt; int &gt; A;
  
    cout &lt;&lt; endl &lt;&lt; endl; 
    cout &lt;&lt; " ***************** " &lt;&lt; endl;
    cout &lt;&lt; " *  TEST SET #1  * " &lt;&lt; endl;
    cout &lt;&lt; " ***************** " &lt;&lt; endl;
  
  
    cout &lt;&lt; "Is the list empty? " &lt;&lt; boolalpha &lt;&lt; A.isEmpty() &lt;&lt;endl; 
    cout &lt;&lt; A &lt;&lt; endl;
    cout &lt;&lt; "Size of A = " &lt;&lt; A.size() &lt;&lt; endl;
  
    //TEST : Inserting 10 numbers to a
    cout &lt;&lt; endl &lt;&lt; "TEST : Inserting 10 numbers to A" &lt;&lt; endl;
    for (int k=0; k&lt;10; k++)
    {
      A.insert_front(k+1);
    } 
    cout &lt;&lt; A &lt;&lt; endl;
    cout &lt;&lt; "Size of a = " &lt;&lt; A.size() &lt;&lt; endl;
  
    //TEST : Clearing A
    cout &lt;&lt; endl &lt;&lt; "TEST : Clearing A" &lt;&lt; endl;
    A.clear();
    cout &lt;&lt; A &lt;&lt; endl;
    cout &lt;&lt; "Size of A = " &lt;&lt; A.size() &lt;&lt; endl &lt;&lt; endl;
  
  
    cout &lt;&lt; "Test 01 - Done!" &lt;&lt; endl;
  } // Destructor Called Here!!
  
  int main () {
  
    cout &lt;&lt; "Hello World!!, This is the LinkedList LARGE Tester" &lt;&lt; endl; 
  
    test01();
  
  
    cout &lt;&lt; "LARGE Done!" &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>LinkedList.hpp (what i'm allowed to modify)</p>
  
  <pre><code>#include "linkedlist.h"
  
   // --------
   // ---- Basic Accessor Operations ---
   // --------
   // Purpose: accessor function for the current # data values in the list
   // Returns: current size of the list
   template &lt;class T&gt;
   int LinkedList&lt;T&gt;::size() const
   {
   }
  
    // Purpose: puts the data x in the front of the list 
    // Parameters: x is data value to inserted
    // Postconditions: x is the first element of the list
   template &lt;class T&gt;
   void LinkedList&lt;T&gt;::insert_front(const T&amp; x)
   {
    if(m_next == NULL)
    {
     m_next = new LinkedList&lt;T&gt;;
     m_next-&gt;m_data = x;
     m_next-&gt;m_next = NULL;
    }
  
    LinkedList&lt;T&gt; *temp;
    temp = new LinkedList&lt;T&gt;;
    temp-&gt;m_data = x;
    temp-&gt;m_next = m_next;
    m_next = temp;
  
   }
  </code></pre>
  
  <p>LinkedList.h (not allowed to modify)</p>
  
  <pre><code>template &lt;class T&gt;
  class LinkedList
  {
  public:
    T m_data;                // Data to be stored
    LinkedList&lt;T&gt;* m_next;      // Pointer to the next element in the list
    static T m_objerr;
  
      // Purpose: Default constructor
      // Postconditions: next pointer set to NULL
      // -INLINE-
    LinkedList() : m_next(NULL) {}
  
      // Purpose: Auxiliaty constructor, construct from parameters
      //     useful when inserting elements
      // Postconditions: data and next pointer set to parameters
      // -INLINE-
    LinkedList(const T&amp; x, LinkedList&lt;T&gt;* p) 
               : m_data(x), m_next(p) {}
  
     void insert_front(const T&amp; x);
  
     int size() const;
  
  }
  </code></pre>
  
  <p>After compiling the list <code>cout</code> is correct but theres an added node at the beginning that contains the address location for that node. I tried quite a few ways but none of them seem to remove that last node no matter what.</p>