Question 15
Back to Exercise
Which type can be initialized as T t{1, 2}; without a constructor?
- A struct T { int a; int b; }; Correct
- B class T { int a; int b; };
- C struct T { T(int); int a, b; };
- D struct T { virtual void f(); int a, b; };
Correct Answer: Option A
An aggregate has public data, no user-declared constructors and no virtual functions. The class version has private members.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!