Copy Constructor is called when an object is either passed by value, returned by value, or explicitly copied . If there is no copy constructor, c++ creates a default copy constructor which makes a shallow copy.
Read moreWhere the copy constructor is used in C++?
When is a Copy Constructor Called in C++? 1) When an object of the class is returned by value . 2) When an object of the class is passed (to a function) by value as an argument. 3) When an object is constructed based on another object of the same class. 4) When the compiler generates a temporary object.
Read more