title: How to replace the new operator in linked list?
body: <p>As a new comer to c++, I am trying to learn why and where to use New.
  So I am trying to NOT USE the New in this linked List example,</p>
  
  <pre><code>////////////////////////////////////////////////////////////////
  struct link //one element of list
  {
      int data; //data item
      link* next; //pointer to next link
  };
  ////////////////////////////////////////////////////////////////
  class linklist //a list of links
  {
  private:
      link* first; //pointer to first link
  public:
      linklist() //no-argument constructor
      { first = NULL; } //no first link
      void additem(int d); //add data item (one link)
      void display(); //display all links
  };
  //--------------------------------------------------------------
  void linklist::additem(int d) //add data item
  {
      link* newlink = new link; //make a new link
      newlink-&gt;data = d; //give it data
      newlink-&gt;next = first; //it points to next link
      first = newlink; //now first points to this
  }
  //--------------------------------------------------------------
  void linklist::display() //display all links
  {
      link* current = first; //set ptr to first link
      while( current != NULL ) //quit on last link
      {
          cout &lt;&lt; current-&gt;data &lt;&lt; endl; //print data
          current = current-&gt;next; //move to next link
      }
  }
  ////////////////////////////////////////////////////////////////
  int main()
  {
      linklist li; //make linked list
      li.additem(25); //add four items to list
      li.additem(36);
      li.additem(49);
      li.additem(64);
  
      return 0;
  }
  </code></pre>
  
  <p>to the following:</p>
  
  <pre><code> ////////////////////////////////////////////////////////////////
  struct link //one element of list
  {
      int data; //data item
      link* next; //pointer to next link
  };
  ////////////////////////////////////////////////////////////////
  class linklist //a list of links
  {
  private:
      link first; //pointer to first link
  public:
      linklist() //no-argument constructor
      { first = NULL; } //no first link
      void additem(int d); //add data item (one link)
      void display(); //display all links
  };
  //--------------------------------------------------------------
  void linklist::additem(int d) //add data item
  {
      link newlink; //make a new link
      newlink.data = d; //give it data
      newlink.next = first; //it points to next link
      first = newlink; //now first points to this
  }
  //--------------------------------------------------------------
  void linklist::display() //display all links
  {
      link current = first; //set ptr to first link
      while( current != NULL ) //quit on last link
      {
          cout &lt;&lt; current.data &lt;&lt; endl; //print data
          current = current.next; //move to next link
      }
  }
  ////////////////////////////////////////////////////////////////
  int main()
  {
      linklist li; //make linked list
      li.additem(25); //add four items to list
      li.additem(36);
      li.additem(49);
      li.additem(64);
      return 0;
  }
  </code></pre>
  
  <p>but this doesn't work. Before I continue trying, I am wondering if this particular example has to stick with New and cannot be done without using it.</p>