11.2 Modules
Your task now is to sensibly divide the modules of your part of the program for your own project. For this, you need to answer the question, for example, “What belongs in main.obj, teil1.obj, and teil2.obj?” And along with that: “What belongs in the main.cpp, teil1.cpp, and teil2.cpp source code files?”
main.cpp should probably contain int main(). Instead of naming the file main.cpp, program.cpp is also a reasonable name if your program will later be called programm.exe.
Otherwise, you should break your project into parts based on functionalities. Each part goes into a separate set of *.cpp files. Each *.cpp file, in turn, is complemented by a similarly named *.hpp file. The exception is main.cpp, for which you normally do not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access