Quote:
|
Originally Posted by Smithvillefirst
I've tried this, but it won't work. In a file globals.h, I have the following:
int myvar;
Then, in user_routines.c I have:
#include "globals.h"
extern int myvar;
|
That's exactly backwards. You should put the extern declaration in the .h file, and actually define the variable in only one .c file.