I understand that in C we can do
int foo[3];
foo[0]=1;
foo[1]=2;
foo[2]=3;
However in Interactive C, it gives me an error. I can only declare everything at once, such as
int foo[3] ={1,2,3};
Anyone familiar with Interactive C knows why is this the case? Is that in IC, you cannot pass in value one by one at all?
I found out the reason it gave me an error is because the declared more int variables after the array assignment. For example,
This will not compile, it will highlight the “int bar” line and shows a syntax error.
seems like one cannot declare more variables with their types after the array assignment.
This might due to the fact that IC is an simplified version of C.