Static global variables in C++
Static is a keyword with many meanings, and in this particular case, it means not global (paraphrasing) It means that each .cpp file has its own copy of the variable. Thus, when you initialize in main.cpp, it is initialized ONLY in main.cpp. The other files have it still uninitialized. First thing to fix this would … Read more