Science, asked by anushri2685, 1 year ago

Merits and demerits of copy construction in c++

Answers

Answered by kiran5111
2
Well if we are talking about the default copy constructor, then the disadvantage it suffers from is that i does a shallow copy of the class object.<br>Which means that if the class has some dynamic memory allocated or file pointers, the copied object will also point to the same memory location or files. That is the memory or file is not copied.
Similar questions