why does the array doesn't get initialized by global variable , even though it should not?
- by ashish yadav
why does the array a does not get initialized by global variable 'size'.
include
int size=5;
int main()
{
int a[size]={1,2,3,4,5};
printf("%d",a[0]);
return 0;
}
the compilation error is shown as "variable-sized object may not be initialized".
according to me the array should get initialized by 'size'.
i apologize if i am not clear but i feel i have expressed myself well enough.
thank you!!!!!!!!!!!