I've read quite a few books and other stuff about C++ but they don't seem to go into a huge amount of detail about how to structure an increasingly large project into different files so it's more easily navigatable. There's a few questions that I'd like anyone who can help me out to answer:
1) My cpp files seem to have quite a large amount of code before the first function, e.g include files from the Platform SDK etc, odd one or two global variables and some other stuff. What's the best practice to cut this info down? The way I'm doing it at the moment is to make a header file with the same name as the cpp and put some of it in there leaving only lines like #include <windows.h> in the top of the cpp file and including it like #include "myprog.h". Am I going about it the right way?
2) When I start moving functions that are related into seperate files to make it easier to navigate my app I have to start adding function prototypes at the top of the calling cpp file which calls the functions in the newly created file so I don't generate undeclared identifier errors. This seems to make more clutter at the top of the file and sometimes extern variable declarations to access things like CRITICAL_SECTION variables also clutter up the file. what's the best way to organise all this stuff?
I think you can probably guess my general problem, those were only a couple of examples.
I can post some examples if it helps at all.