Question 6
Back to Exercise
In std::array<int, 5>, what kind of template argument is 5?
- A A type argument
- B A non-type argument – a compile-time constant value Correct
- C A default argument
- D A run-time variable
Correct Answer: Option B
It must be known at compile time: int n = 5; std::array<int, n> does not compile.
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!