Considering
gcc -c main.C
gcc -lstdc++ -o main main.o
And main.C
#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 lead to a compiler error? I thought C ++ does not have a VLA?
Program execution is working fine.
source
share