The easiest way to get a truly global variable (accessible across multiple translation units) is to declare it in the common header, and define it in a special translation unit:
/* header.h */
#include "defs.h"
extern int memory[SIZE];
/* header.c */
#include "header.h"
int memory[SIZE];
Now you can include header.h in your other source files, compile and link header.c along with the rest of your project, and everyone can use the memory array.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401