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

Answer Posted / dee

assignment operator copies the values of one object to
another of the same class.It will excute only when the
right side of the variable is object and two sides are not
equal.It does shallow copy

Copy constructor craetes the object if its not existing and
copies the values of another object of the same class and
it does the deep copy.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the return value of the insertion operator?

828


What is ios flag in c++?

865


How is objective c different from c++?

991


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

833


What are signs of manipulation?

812


What are associate containers?

802


What is meant by the term name mangling in c++?

710


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

809


Is c++ slower than c?

779


What are compilers in c++?

820


what are Access specifiers in C++ class? What are the types?

835


What is dynamic and static typing?

874


Can constructor be static in c++?

841


What is prototype in c++ with example?

725


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

869