I don\'t really understand why I can\'t have a variable size array on the stack, so something like
foo(int n) {
int a[n];
}
As I underst
Note that the proposal was rejected and the following is no longer true. It may be revived for a future version of C++ though.
VLA as described in N3639 has been accepted in Bristol meeting and will become part of C++14, as well as a library counter-part "dynarray". So using compiler with C++14 support we can start writing something like:
void func(int n)
{
int arr[n];
}
Or use dynarray:
#include
void func(int n)
{
std::dynarray arr(n);
}