An error should appear in the code below, since the compiler cannot know the size of the array at compile time.
int f; std::cin >> f; int c[f]; c[100] = 5;
I am compiling with gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, and it not only compiles, but works somehow.
How does this happen?
c ++ gcc variable-length-array
v010dya
source share