I have a simple program like:
int velocity=0;
#include "extra.h"
int main()
{
extra();
return 0;
}
where extra.h
is:
void extra(){
velocity += 1;
}
yet when I compile this, I get the error:
extra.h:5:5: error: 'velocity' was not declared in this scope
Obviously, my code in extra.h
can't "see" the variables in main.c, but why is this? How do I fix this?