I want to overload the operator =, but my object has pointers, so when I do the return, eventually it passes a copy and so my destructor kills it... how to prevent the desctructor killing? my code is the following
If your class "owns" dynamically allocated memory, then you should implement not only the destructor and copy assignment, but also the copy constructor.
Please show at least the class definition and destructor.