Variable length arrays are not part of standard C++. Array bounds must be compile-time constant expressions.
GCC and Clang both provide VLAs as an extension, but VisualStudio does not. Use std::vector
if you need a cross-platform non-constant length array.