Jan 30, 2013 at 5:18pm
I'm using the following statements to initialise array
int d;
cin >> d;
int array[d];
and these are working properly!
isn't this incorrect?
shouldn't the array be initialized dynamically using new
Jan 30, 2013 at 6:21pm
Just in case that link dies someday...
@ tdk93: this is a feature of C99 (the C language standard of 1999), which works in some C++ compilers, but C++ doesn't officially support it.
The feature is called VLA: variable-length arrays, because the array length is a variable and not a constant.
Last edited on Jan 30, 2013 at 6:22pm