What is the Diffrence between a "assignment operator" and a
"copy constructor"?

Answer Posted / kishore

Copy constructors are used during class object
initialization and assignment operators are invoked during
object assignment.

XYZ c;
XYZ Obj = c; -> invoke copy constructor
XYZ d;
d = c; -> invoke assignment operator

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the indirection operator and the address of oper-ator?

606


What is encapsulation in C++? Give an example.

588


What is recursion?

658


Describe delete operator?

624


When we use Abstract Class and when we use Interface?where we will implement in real time?

1666






write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1459


What is binary object model?

600


What is abstract keyword in c++?

591


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

613


How does java differ from c and c++?

540


Is c++ proprietary?

581


What is else syntax in c++?

642


Why c++ is called oop?

593


Is c++ an oop?

590


What is conditions when using boolean operators?

599