Given
gcc -c main.C
gcc -lstdc++ -o main main.o
And main.C being
#include <iostream>
int main() {
int somany;
std::cin >> somany;
double ex[somany];
for(int i=0;i<somany;i++){
ex[i]=0.03;
std::cout << ex[i];
}
}
Why does this not result in a compiler error? I thought C++ does not have VLAs?
Executing the program works just fine.