Q
Is int n; cin >> n; int a[n]; standard C++?
-
A
Only when n is less than 100
-
B
Yes, since C++11
-
C
Yes, always
-
D
No; variable-length arrays are not part of standard C++ (some compilers accept them as an extension)
Correct Answer:
D. No; variable-length arrays are not part of standard C++ (some compilers accept them as an extension)
Explanation:
VLAs exist in C99, but not in ISO C++. Use std::vector instead.