For example, when I define a class file in C ++, I always put function bodies in the class header files (.h) along with the class definition. The source code file (.cpp) is a file with the main () function. Now this is usually done among C ++ programmers or they follow the convention of the individual header / source files.
As for Native C, I notice that this is done in GCC (and, of course, for headers in Visual Studio for Windows).
So is it just a convention? Or is there a reason for this?
.cpp :
.cpp
, , , . , , .
, , , , .
. , , , .
, (.. ), , , , ( ).
"" (.. , ).
, , . , "" , .
, inline , (.. ) , ( ) .
, .
, . , , , (), , header only, (s).
header only
; , , , . - .. , , , , . , , - . , , .
, , , . .
, , , , , . .
'c'. 'c', . "", , , .
++. "" .
cpp, .