title: Implementing copy constructor in a single linked list C++
body: <p>I have a C++ code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  struct Node;
  
  typedef Node *NodePtr;
  
  struct Node
  {
      int Item;
      NodePtr Next;
  };
  
  class LinkedList
  {
  public:
      LinkedList();                   // default constructor
      ~LinkedList();                  // destructor
      void AddTail(int);              // adds item to tail
  private:
      NodePtr Head;
  };
  
  LinkedList::LinkedList()
  {
      Head = NULL; //declare head as null
  }
  //Adding on tail
  void LinkedList::AddTail(int Item)
  {
      NodePtr Crnt;
      NodePtr node = new Node;
      node-&gt;Item = Item;
      node-&gt;Next = NULL;
  //if head is in null declare the added node as head
      if (Head == NULL)
      {
          Head = node;
      }
      else
      { //set the current to head, move the current node to current next node
          Crnt = Head;
          while (Crnt-&gt;Next != NULL)
          {
              Crnt = Crnt-&gt;Next;
          }
          //Add item to the tail of the linked list
          Crnt-&gt;Next = node;
      }
  }
  
  int main()
  {
      LinkedList la;
      la.AddTail(30);
      la.AddTail(60);
      la.AddTail(90);
      LinkedList lb;
      return 0;
  }
  </code></pre>
  
  <p>So my question is how do I implement a copy constructor(suppose on object lb) that makes a deep copy of the list argument and also adding code for testing the copy constructor on empty and non-empty lists? 
  Thanks in advance.</p>