Question 17
Back to Exercise
What is the type of x in auto x = {1, 2, 3};?
- A int
- B std::vector<int>
- C std::initializer_list<int> Correct
- D int[3]
Correct Answer: Option C
auto x{5}; gives int, but copy-list-initialisation with = {…} deduces an initializer_list.
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!