[Study Notes] the inclusion of the [C Language] file and the C language of study notes
I. Basic Concepts
# Include, which can copy all the content of one file to another.
II. General Form
1. 1st forms # include <File Name>
Go to the directory where the function header file of the C language library is located to find the file.
2. 2nd forms # include "file name"
The system first searches for the source code in the current directory. If the source code cannot be found, it searches for the path in the path of the operating system before searching in the directory where the function header file of the C language library is located.
Iii. Usage notes
# The include command allows nested inclusion, such as. h contains B. h, B. h contains c. h, but recursive inclusion is not allowed, such as. h contains B. h, B. h contains. h.
Iv. Code
1.
. H file
1 #ifndef LISI_H2 #define LISI_H3 4 int sum(int a, int b);5 6 7 #endif
. C file
int sum(int a, int b){ return a + b;}
2.
. H file
1 #ifndef WANGWU_H2 #define WANGWU_H3 int minus(int a, int b);4 #endif
. C file
1/* 2 1. <> indicates the built-in file, and "" indicates the custom file 3 2. loop inclusion is not allowed, such as. h contains B. h, B. h also contains. h 4 */5 6 # include "lisi. h "7 # include" wangwu. h "8 9 # include <stdio. h> 10 11 int main () 12 {13 int c = sum (10, 19); 14 15 printf ("c is % d \ n", c ); 16 17 return 0; 18}