I'm doing an assignement where I'm writing copy constructors and operator= constructors to copy objects with pointers in them. Every time an object is copied a variable named size should increase with 1.
So, when i copy to an object that is also created at the same time, the copy constructor is invoced, as it should. But when i copy to an existing object, both copy constructor and = constructor is invoked. Have I made an error in the design of the constructors?