include
#include
Recommended tutorial: "c Language Tutorial"
There are two types of header files:
The header files written by the programmer and the compiler's own header files header file.
To use a header file in a program, you need to use the C preprocessing directive #include to reference it.
stdio.h
Header file, it is the header file that comes with the compiler.
Referring to the header file is equivalent to copying the contents of the header file, but we will not directly copy the contents of the header file in the source file, because it is easy to make mistakes, especially when the program is composed of multiple source files. when.
Extended information
The concept of preprocessing in programming languages:
Processing before compilation. There are three main aspects of preprocessing in C language: macro definition; file inclusion; and conditional compilation. Preprocessing commands begin with the symbol "#". In addition to function prototypes and macro definitions, the content of the header file can also have structure definitions and global variable definitions:
A #include command specifies a header file; file 1 includes file 2, and file 2 uses file 3. Then the include command #include of file 3 should be placed on the first line of the header of file 1;
includes can be nested;
Static global variables in the included file do not need to be declared in the included file.
The above is the detailed content of What does include