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
class type to basic type conversion
Which type does string inherit from?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is protected in oop?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
Why is static class not inherited?
Why do we use inheritance?
What is encapsulation in ict?
What are the two different types of polymorphism?
What is the purpose of polymorphism?
What is the problem with multiple inheritance?
How do you define social class?
What is polymorphism programming?
Who invented oop?
• What are the desirable attributes for memory managment?