this will help You posted a copy constructor and assignment operator. Your assignment operator has 4 major issues: You should pass the parameter by const reference, not by value. You should return a reference to the current object, not a brand new object. If new throws an exception during assignment, you've messed up your object by deleting the memory beforehand. It is redundant. The same code appears in your copy constructor.