Wait, does OP need a function to create the variable? I thought we were doing
header:
extern double phys_MO;
one C file:
double phys_MO = 4.29496E-6;
Type: Posts; User: tabstop
Wait, does OP need a function to create the variable? I thought we were doing
header:
extern double phys_MO;
one C file:
double phys_MO = 4.29496E-6;
One time. If you don't put extern on it in the header, then you're declaring it a lot of times -- one time every time you #include the header.
I'll bet you a nickel that you now have two .o files in that directory. And also, if you put int X=5 in your two.c file you'd get different answers.
EDIT: Nope, I'm wrong. GCC doesn't write out...
You should look at the word "extern".