1)
const int array_const []= {1,2,3,4,5,6}; //ok
float float_array[array_const[2]]; // Throws an error "array bound is not an
int main() {} integer constant"
2)
int char_array = 126; //ok
int glob_array[char_array]; // Throws an error "array bound is not an integer
int main() {} constant"
Above pice of the code (1 & 2) throws an error "array bound is not an integer constant" From above error I understood that compiler not reading content of the storage at compile time.
I am not understand why its not reading. Please can someone explain me in details ?
---------------------------------------------
const int char_array = 126; //ok
int glob_array[char_array]; // ok
int main() {}
Above pice of the code work fine without an issue.
Also let me know In C why below statement throws "variably modified store_char at file scope" error
#include<stdio.h>
const int maxarray=255;
char store_char[maxarray];
int main() {
}