main.cpp
file, a global.h file that declares some global variables, and then A.h and A.cpp files which declare and define a function that manipulates those variables. All of these files are guarded, yet I am receving "multiple declaration" errors when I try to compile. Here is the code:
|
|
|
|
|
|
|
|
|
|
extern
modifier, you are declaring them and telling the compiler they are to be defined somewhere. Since you pass only once by the source file where you define them, no multiple definitions.