A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.
Copy constructors are called in following cases:
(a) when a function returns an object of that class by value .
(b) when the object of that class is passed by value as an argument to a function .
(c) when you construct an object based on another object of the same class .
(d) When compiler generates a temporary object .