Answer to Question #4704 in C++ for Xentia

Question #4704
What is the difference between a copy constructor and an overloaded assignment operator?
1
Expert's answer
2011-10-18T08:35:59-0400
At first, 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.
Second, a copy constructor has no return type, whereas an overloaded assignment operator has one.
And the third: name of the copy constructor is the same as that of the class in which it is defined.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS