What is the difference between a copy constructor and an
overloaded assignment operator?
Answer Posted / guest
A copy constructor constructs a new object by using the
content of the argument object. An overloaded assignment
operator assigns the contents of an existing object to
another existing object of the same class.
| Is This Answer Correct ? | 44 Yes | 12 No |
Post New Answer View All Answers
Define stacks. Provide an example where they are useful.
Can we delete this pointer in c++?
How are pointers type-cast?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.
What is the copy-and-swap idiom?
Do class declarations end with a semicolon? Do class method definitions?
Write a program to show polymorphism in C++?
What are the restrictions apply to constructors and destructors?
Why is "using namespace std;" considered bad practice?
Is there finally in c++?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What is a map in c++?
What is the purpose of the "delete" operator?
Can create new c++ operators?
What is the this pointer?