A question on the right way to use extern with multidim arrays
#define dim1 10
#define dim2 10
int a[dim1][dim2];
main(){
int foo();
extern int a[][];
}
foo(){
extern int a[][];
...
}
compiles fine, but in foo, a[][] is undefined
-unless I am missing something
while if in the main and foo I say
extern int a[dim1][];
I get a compilation error
invalid use of array with unspecified bounds
#define dim1 10
#define dim2 10
int a[dim1][dim2];
main(){
int foo();
extern int a[][];
}
foo(){
extern int a[][];
...
}
compiles fine, but in foo, a[][] is undefined
-unless I am missing something
while if in the main and foo I say
extern int a[dim1][];
I get a compilation error
invalid use of array with unspecified bounds