Possible Duplicate:
Variable length arrays in C++?
I am just curious, is there any particular reason why C++ does not allow variable length arrays?
Possible Duplicate:
Variable length arrays in C++?
I am just curious, is there any particular reason why C++ does not allow variable length arrays?
Two reasons:
std::vector<>
and a whole bunch of other containers, which is why I believe that C++ will never bother with VLAs. It already had them when VLAs were invented for C. The STL includes a Vector class to use. Technically, you could use an array whose index variable is a pointer, leading to a "variable length" array.