I tried
const int i[] = { 1, 2, 3, 4 };
float f[i[3]]; // g++ cries "error: array bound is not an integer constant"
int main()
{
const int j[] = { 0, 1, 2, 3 };
float g[j[3]]; // compiler is happy :)
return 0;
}
What is the difference between the two aggregates? How come referring to a const aggregate's element inside main() is valid when it's invalid @ the global scope?