Compile relevant knowledge point records

1. The relationship between .cpp; .h and compilation

During the compilation process, the compiler can only see the implementation of the current .cpp, so if the current .cpp uses external functions/classes, it needs to be declared in advance
But if
    case 1: a.cpp uses 100 in b.cpp If a function uses 300 functions in c.cpp, it is too much to write the declaration in front of .cpp.
    Case 2: If 20 functions in b.cpp are used by other 100 .cpp, once b. The name of the function used in cpp has been modified. Do you want to modify the other 100 .cpp declarations?
At this time, the function of the header file .h is displayed, just include bh and ch directly. The
header file has no compiling meaning, and generally just compiles .cpp to generate .obj. That is, https://blog.csdn.net/weixin_44363885/article/details/96370807 is only used in the compilation phase

Guess you like

Origin blog.csdn.net/CSDN_WHB/article/details/118118092