|
Re: Using the extern keyword.
extern is only used in the first declaration of variable in a file - treat it just as if you were declaring the variable normally, extern just says "this variable was originally declared in another file, and the same copy should be used here".
also, remember that exactly one file should have the variable declared without "extern" - all of the other files extern this original declaration.
Finally, remember that extern only really works for global variables. So make sure your extern-ed variables are declared outside of any function calls.
--edit-- lol, it happened again.
|