Preprocessor directives

后端 未结 3 1314
故里飘歌
故里飘歌 2020-12-21 04:42

When we see #include , it is said to be a preprocessor directive.

#include ---> directive

And, I think:

3条回答
  •  猫巷女王i
    2020-12-21 05:38

    Preprocessor directives, such as #define and #ifdef, are typically used to make source programs easy to change and easy to compile in different execution environments. Directives in the source file tell the preprocessor to perform specific actions. For example, the preprocessor can replace tokens in the text, insert the contents of other files into the source file...

    #include is a preprocessor directive meaning that it is use by the preprocessor part of the compiler. This happens 'before' the compilation process. The #include needs to specify 'what' to include, this is supplied by the argument iostream. This tells the preprocessor to include the file iostream.h.

    More information:

    • Preprocessor Directives on MSDN
    • Preprocessor directives on cplusplus.com

提交回复
热议问题