Answer Posted / namitha
A copy constructor is used in the following cases.
-When an object is created from another object of the same
type.
-When an object is passed by value as a parameter to a
function.
-When an object is returned from a pointer.
-when we want to set a default value for the data members.
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is the use of default constructor?
How can you say that a template is better than a base class?
Explain the uses oof nested class?
What are the benefits of c++?
what kind of projects are suitable for c and c++
what are the iterator and generic algorithms.
Explain the virtual inheritance in c++.
Write a program to add three numbers in C++ utilizing classes.
If I is an integer variable, which is faster ++i or i++?
What is overloading unary operator?
What are smart pointers?
What is cin clear () in c++?
What is private, public and protected inheritance?
What is c++ best used for?
Is map ordered c++?