Showing posts with label What is the difference between a copy constructor and an overloaded assignment operator. Show all posts
Showing posts with label What is the difference between a copy constructor and an overloaded assignment operator. Show all posts

What is the difference between a copy constructor and an overloaded assignment operator

What is the difference between a copy constructor and an overloaded assignment operator?
A: 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.