#include
does none of both, neither "importing" libraries, nor classes or modules.
The #include
directive just tells the pre-processor to include the contents of another text file (source). That's all.
The result of pre-processing file A #include
ing file B is passed to the compiler as if they were one file, with file B pasted into file A at the position where the #include
directive was placed.
To expliclity state this: This all happens prior to any compilation, code generation.
As a side effect the C/C++ pre-processor could be used independently from the compiler to process any kind of text file input.
One could argue that pre-processor statements like #include
"are not really part of the C/C++ languages", as they are not essentially needed to write any programs in C/C++, as they are never passed to the compiler.
The expression import
is not used in the context of (standard) C/C++ programming, as there is nothing to be imported.
C/C++ modules are put together either on source level prior to compilation or by the linker after compilation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…