I need to have a couple arrays in a file and I want to be able to access it from another C file. I have defined them in a header file, arrays.h and then I initialize them in a arrays.c file. The problem is, when trying to access the array's indices from another file, I get a unresolved external ... LNK2001 error. I think it's because, the 'arrays.c' file is never compiled, so my program knows the array exists, but cannot access it because that file 'arrays.c' is never called so the array is not initialized.
Am I right? Is there any way to fix this problem keeping the source like it is?
arrays.cfile is not part of the project properly. Otherwise it should have been compiled and linked together with the other files. Also, make sure your spelling is correct.