#include using namespace std; const int vals[] = {0, 1, 2, 3, 4}; int newArray[ vals[2] ]; //\"error: array bound is not an integer constant\"
It's possible that the value of a const expression is not even known at compile time. For example, you can initialize a constant with something returned from a function, like
const
const int size = rand(); // random size
So it is not that constant as you might think