Skip to content
Related Articles

Related Articles

C++ | Constructors | Question 1
  • Difficulty Level : Easy
  • Last Updated : 04 Jan, 2013
GeeksforGeeks - Summer Carnival Banner

Which of the followings is/are automatically added to every class, if we do not write our own.
(A) Copy Constructor
(B) Assignment Operator
(C) A constructor without any parameter
(D) All of the above


Answer: (D)




 

Explanation: In C++, if we do not write our own, then compiler automatically creates a default constructor, a copy constructor and a assignment operator for every class.

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
Recommended Articles
Page :