We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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)
Arrays Introduction
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)
http://en.cppreference.com/w/cpp/container/vector