What is the difference between Copy Constructor and Assignment Overloaded Operator?

Copy Constructor: 

Copy Constructor is a default member function of the class that initialize a new object with the existing object. It is called constructor because it create an object and copy the data bit by bit from existing object to the new object. Below is the syntax for copy constructor.

Assignment Operator:

An assignment operator assign the content of an existing object to another existing object, As it is an operator not the constructor so it does not create any new object. Below is the syntax for copy constructor.

Example: 

50 total views, 5 views today

Posted in

Leave a Reply