You are viewing a single comment's thread. Return to all comments →
Beware coders, g++ (likely the compiler being used here) allows variable length arrays. However, if you compile using g++ -pedantic, it will not compile because ISO C++ forbids variable length arrays. Typically array length is specified at compile time. This is a g++ extension to the language vs standard c++.
There is a solution using std::vector (std::vector allows run-time dynamic array length)