#include <iostream>
usingnamespace std;
int main ()
{
int arrsize;
cout << "Enter array size: ";
cin >> arrsize;
int a [arrsize];
for (int i = 0; i < arrsize; i++){
cout << "Enter array values: ";
cin >> a [i];}
for (int i = 0; i < arrsize; i++)
cout << a [i];
return 0;
}
Assuming you're referring to the fact that you're declaring a runtime-sized array like a fixed-size array, it was nonstandard. Compilers supported this as extensions to the language.
IIRC it was standardized in C++14 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3497.html
Actually this "feature" didn't make it into the standard. VLA are still not supported by the current standards, and hopefully never will be. If you want this "feature" I recommend using std::vector.
Now after saying the above, several compilers support this "feature" as a compiler specific option, which is why the program is compiling.