C++ | Constructors | Question 1

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)

filter_none

edit
close

play_arrow

link
brightness_4
code

 

chevron_right


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.



My Personal Notes arrow_drop_up


Article Tags :

1


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