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
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is abstract class in oop?
What is polymorphism what is it for and how is it used?
What is byval and byref? What are differences between them?
What are objects in oop?
Are polymorphisms mutations?
What is this pointer in oop?
What is the real time example of inheritance?
What are oops methods?
What is encapsulation in oops?
What is class and object in oops?
What does and I oop mean?
What is a class and object?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What is the difference between static polymorphism and dynamic polymorphism?