title: How to remove duplicates from a doubly linked list by full name
body: <p>I have a doubly linked list in which it stores player objects.  The player object contains first name, last name, level and experience.  Im trying to create a function that will remove a duplicate player object.  For instance, if I enter Luis suarez and then he is entered again, I want the function to ask the user to enter the duplicates name and delete one of the luis suarez players (preferably the one last in the list).  I've tried many things and none of them work nor delete anything. Can anyone help me with this?</p>
  
  <p>Here is my try at RemoveDuplicate:</p>
  
  <pre><code>// -------------------------------------------------------------------------------------------------------
  //  Name:           RemoveDuplicates.
  //  Description:    Searchs through the list and finds duplicates and removes one.
  // -------------------------------------------------------------------------------------------------------
  
  void RemoveDuplicates(DoublyLinkedListIterator&lt;Datatype&gt; m_itr, string searchByFirstName)
  {
      Stats player;
      string playerDuplicate = player.getFirstName();
      for (m_itr.Start(); m_itr.Valid(); m_itr.Forth())
          {
              if (m_itr.Item().getFirstName() == searchByFirstName)
              {
              playerDuplicate = m_itr.Item().getFirstName();
              }
          }
      delete(playerDuplicate);
  }
  </code></pre>
  
  <p>My stats class has 4 member variables with getters.</p>
  
  <pre><code>private:
      string firstName;
      string secondName;
      int level;
      int experience;
  </code></pre>
  
  <p>In my linked list I have 3 classes.</p>
  
  <pre><code>DoublyLinkedListIterator;
  DoublyLinkedList;
  DoublyLinkedListNode;
  </code></pre>
  
  <p>Any help is greatly appreciated.  </p>
  
  <p>EDIT: Follow-up: <a href="https://stackoverflow.com/questions/16126160/removing-duplicates-from-a-doublylinkedlist-c/16126231#16126231">Removing duplicates from a DoublyLinkedList</a></p>