C++ | Constructors | Question 2

When a copy constructor may be called?
(A) When an object of the class is returned by value.
(B) When an object of the class is passed (to a function) by value as an argument.
(C) When an object is constructed based on another object of the same class
(D) When compiler generates a temporary object.
(E) All of the above

Answer: (E)

Explanation: See When is copy constructor called?

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.