Having this simple C++ code:
// there MUST be the *const* keyword!
const int g_size = 8;
char g_arr[g_size] = {0};
int main(){
// there MUST'T be the *const* keyword
int l_size = 8;
char l_arr[l_size] = {0};
...
}
Can someone please explain me why does the global array g_arr CAN'T be initialized using non const variable (removing the modifier yields an error "array bound is not an integer constant...") but local array l_arr CAN?