Related Articles

Related Articles

QA – Placement Quizzes | SP Contest 2 | Question 5
  • Last Updated : 18 Jul, 2018

Select the statements that are true about default and copy constructors in C++:

  1. Compiler doesn’t create a default constructor if the user writes any constructor except the copy constructor.
  2. Compiler creates a copy constructor if the user doesn’t write its own copy constructor.
  3. Compiler doesn’t create a default constructor if the user writes any constructor even if it is copy constructor.

(A) 1 and 2
(B) Only 3
(C) Only 2
(D) 2 and 3


Answer: (D)

Explanation: https://www.geeksforgeeks.org/does-compiler-always-create-a-copy-constructor/

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :