I have been trying to teach myself how to code for more than a year now, having started with VBA and then switching to c++. Recently I have been forced to confront how horrific my coding practices are, and have been doing pennance by trying to modify 1500 lines of spaghetti code for a different, but related project. My questions is not about any specific code, but rather seeking guidance on how a project is best organized.
I understand that class declarations go into header files and contain function prototypes, but where should I flesh out the function? Previously I had just thrown everything into "main.cpp" and just stacked modules as high as I had to. What belongs in "main.cpp"? What should be thrown into other ".cpp" or ".h" files? Should the function "main" be a minimal as possible? When is it a good idea to link other ".cpp" files to main?
Apologies for the generality of the question, but the book I bought doesn't seem to discuss this level of organization, and the web forums also seem relatively silent on the subject.
Thanks in advance,