I am trying to declare an array with const value globally as below. But it is giving compilation error saying array size is not a const value.
const int a[] = {1, 2, 3, 4, 5};
int arr[a[1]];
But if I copy the same lines into a function, it is working fine.
Can you please let me know the differences and why it is not working when I tried to declare global array.