The program below does not compile. Which statement correctly describes the problem?
#include <iostream>
int main() {
int n;
std::cin >> n;
int scores[n];
std::cout << sizeof(scores) << '\n';
return 0;
}
GCC and Clang accept VLAs by default as an extension, but with -pedantic-errors (strict standard mode) this is an error. std::vector is the portable solution.