What does “#include ” do?

前端 未结 3 1903
囚心锁ツ
囚心锁ツ 2021-01-30 11:30

As I started learning basic C++, I\'ve always used the headings

#include 
using namespace std;

I want to question what is the

3条回答
  •  清酒与你
    2021-01-30 11:55

    # indicates that the following line is a preprocessor directive and should be processed by the preprocessor before compilation by the compiler.

    So, #include is a preprocessor directive that tells the preprocessor to include header files in the program.

    < > indicate the start and end of the file name to be included.

    iostream is a header file that contains functions for input/output operations (cin and cout).

    Now to sum it up C++ to English translation of the command, #include is:

    Dear preprocessor, please include all the contents of the header file iostream at the very beginning of this program before compiler starts the actual compilation of the code.

提交回复
热议问题