Currently I am quite confused which file must include which one. (using Visual Studio)
If I have in my project just a single file anyname.h with content[code tags are kinda useless for this very small part but I was forced to] then I can`t compile this. But if there is just a single file with anyname.cpp then it will compile. So I reasoned that the compiler just picks up any file and starts compiling.Code:int main() { return 0; }
If I have two files a.cpp and a.h it does not matter where is int main() { return 0; } and where is just int main();.
I think a good way to start is to create main.h and main.cpp. The first thing in main.cpp is #include main.h. But then? Where is best place to include stdlibs such as #include <iostream>? In main.h or main.cpp?
Also if I add other files such as myfunction.cpp and myfunction.h I have currently no clue who need to include who...
Can you recommend me anything to read what is the best way to structure this?