Array[n] vs Array[10] – Initializing array with variable vs numeric literal
In C++, variable length arrays are not legal. G++ allows this as an “extension” (because C allows it), so in G++ (without being -pedantic about following the C++ standard), you can do: int n = 10; double a[n]; // Legal in g++ (with extensions), illegal in proper C++ If you want a “variable length array” … Read more