Answer Posted / guest
You use the assignment operator (operator = ()) whenever an
existing object is to be replaced with a different object.
The copy constructor X(const X&) is used to create a new
instance of an X-object exactly like another.
Notice the subtle difference. Assignment changes an existing
object while construction creates a new object. You can view
assignment as the application of a destructor, to flush away
the existing object, followed by a copy construction, to
make an exact copy of the assigned object.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What polymorphism means?
What is abstraction in oops?
What is the difference between encapsulation and polymorphism?
Why do we use class?
What is constructor overloading in oop?
program for insertion ,deletion,sorting in double link list
State what is encapsulation and friend function?
What is purpose of inheritance?
What is multilevel inheritance?
Why is polymorphism important in oop?
What are the data types in oop?
What are the benefits of oop?
hi all..i want to know oops concepts clearly can any1 explain??
Why multiple inheritance is not possible?
What is oops and its features?