Why a "operator=(...)" when there is a copy ctor?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / arun
Copy Constructor means creation of new object and after that
copy properties of some exiting object to newly created object.
Overloading assignment operator is that copy properties of
some exiting object to another exiting object of same type.
Is This Answer Correct ? | 1 Yes | 0 No |
Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}
Why we use classes in oop?
What are the 5 oop principles?
What do you mean by variable?
What is abstract class in oop?
Why is static class not inherited?
What are the advantanges of modularity
Please tell me the oops concept with detailed answer
i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
what is virtual function?
what is ns string? what is ns array?