martijn@garfield:~/t$ g++ -std=c++11 -pedantic -c -o vararray.o
vararray.cpp
vararray.cpp: In function ‘int main()’:
vararray.cpp:11:21: warning: ISO C++ forbids variable length array
‘arr’ [-Wvla]
int arr[howMany];
^
It's an extension from C, known as Variable Length Array (VLA). It's not
legal C++. It's accepted by many compilers unless you tell them to be
pedantic.
HTH,
M4