i have a very big array which is shared among many functions in many files in a vc project. My problem is, I have to declare it in main() and use extern in the header files. Since the array is too large for the stack i have to use static which makes it impossible to have the extern declaration in the header files.
How can I solve this problem?
EDIT:
What i did was as you said but i get error LNK2001: unresolved external symbol
Here is my global declaration and the extern declaration:
main.c
static unsigned char bit_table_[ROWS][COLUMNS];
hdr.h
extern unsigned char bit_table_[ROWS][COLUMNS];
ROWS and COLUMNS could grow as large as 1024 and 1048576 respectively
mmap
to keep the data separate... – user166390