I have declared an extern global variable inside my main.h header file like this:
extern int variable;
Then, I defined the same global variable inside my main.c file like this:
int variable = 16;
The thing is that I am using another file called test.c, and I have included main.h header included inside. But I cannot gain access the the "16" value that I defined the extern with inside main.c. When I call "variable" inside test.c, the value of "variable" is "0". Should not any .c file that includes my main.h header have access to the "16" value since I have already defined my "variable" inside main.c???
Thanks