Interviews2 answers
2 Answers
Copy constructor will be called when you are creating an object and initializing it with the help of another in a single expression .But on the other hand assignment operator will be called when you are initializing a object by another object not creating it.
Naveen SikriPosted Mar 26, 2007, 12:22 AM EDT
The answer should be, that the copy costructor is called at initializing the object, while the assignment operator used to assign one object by another.
DeepakPosted Nov 28, 2006, 2:20 AM EST