C++ | Constructors | Question 13

We must use initializer list in a constructor when
(A) There is a reference variable in class
(B) There is a constant variable in class
(C) There is an object of another class. And the other class doesn’t have default constructor.
(D) All of the above


Answer: (D)

Explanation: See When do we use Initializer List in C++?

Quiz of this Question



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.