Problem:
FILE1.C:
FILE2.C:Code:int foo[100];
Code:extern int foo[20]; foo[30]=1;
Will the size in FILE2.C be ignored since the allocation is 100 not 20?
Problem:
FILE1.C:
FILE2.C:Code:int foo[100];
Code:extern int foo[20]; foo[30]=1;
Will the size in FILE2.C be ignored since the allocation is 100 not 20?
try compiling it and see what happens.
i honestly don't know the result on this one, although i'm guessing it will print an error in file2.c; because it doesnt know whats in file1.c when it's assembling file2.c. and even if there is no error there there might be errors when you run the linker or your compiled program.
hello, internet!
> Will the size in FILE2.C be ignored since the allocation is 100 not 20?
Yes
Normally, I would write
extern int foo[];