Google News
logo
CPP - Quiz(MCQ)
When a copy constructor is called?
A)
When an object of the class is returned by value
B)
When an object of the class is passed by value to a function
C)
When an object is constructed based on another object of the same class
D)
All of the above

Correct Answer :   All of the above


Explanation : Copy constructor is called in all the above-mentioned criteria because in all the above cases we are somehow trying to copy one object into another.

Advertisement