I know in C that I can do the following.
int test[5] = {1, 2, 3, 4, 5};
Now this is only legal when declaring the array. However I was wondering why this is not legal to do later? But then later in the program it is not legal to do the following.
test[5] = {10, 20, 30, 40, 50};
Or something similar. Why is this? I know it's not legal, and I'm not complaining, but could someone give me a more technical explanation of why I can't do this? (i.e. don't just say the C spec does not allow it or something like that)
I'm assuming it has to do something with the time when memory gets allocated on the stack for the array, so at that point C can auto fill in my values, but then why can't it do it later?
Thanks guys