I'm pretty new to Visual Studio and I'm currently working on a project in which I want to use multiple .cpp files. Basically I want to make a function outside main.cpp in function.cpp and that function should be able to change global variables. Then I'd use that function in main.cpp.
I tried making a header named globals.h and putting static variables in it. I included globals.h in both main and function.cpp and it compiled but whenever I call that function in main it does absolutely nothing. When I try to include function.cpp in main.cpp I get multiple definition error while compiling.
What am I doing wrong? Thanks in advance!