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

Why is c++ is better than c?

517


What is a c++ object?

617


What do you mean by funtion prototype?

585


What it is and how it might be called (2 methods).

658


What is public, protected, private in c++?

657






What is the difference between reference and pointer?

612


the first character in the variable name must be an a) special symbol b) number c) alphabet

605


Explain operator overloading.

600


What flag means?

524


How do you add an element to a set in c++?

551


What is #include ctype h in c++?

667


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

785


How do you find out if a linked-list has an end?

649


What is the header file for setw?

575


How do you traverse a btree in backward in-order?

621