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
Recommended Posts:
- C++ | Constructors | Question 12
- C++ | Constructors | Question 5
- C++ | Constructors | Question 6
- C++ | Constructors | Question 7
- C++ | Constructors | Question 4
- C++ | Constructors | Question 8
- C++ | Constructors | Question 14
- C++ | Constructors | Question 3
- C++ | Constructors | Question 17
- C++ | Constructors | Question 15
- C++ | Constructors | Question 16
- C++ | Constructors | Question 9
- C++ | Constructors | Question 17
- C++ | Constructors | Question 2
- C++ | Constructors | Question 1



