当前位置:网站首页>The order of include header files and the difference between double quotation marks "and angle brackets < >

The order of include header files and the difference between double quotation marks "and angle brackets < >

2022-07-06 09:15:00 it_ xiangqiang



Double quotes ”” And angle brackets <> The difference between


Include The order of header files

about include For the header file , If it's in the file a.h Declare a in the file b.h

Variables defined in , Without reference b.h. Then you have to be in a.c Reference in file b.h file , And first quote b.h, Post reference

a.h, Otherwise, the report variable type does not declare an error .

The difference between double quotation marks and angle brackets :

The path to find the header file in the compiler preprocessing phase is different .

For header files contained in double quotation marks , The order to find the header file path is :

Current header file directory

Header file path set by compiler ( The compiler can use -I Explicitly specify the search path )

System variables CPLUS_INCLUDE_PATH/C_INCLUDE_PATH Specified header file path

For header files included with angle brackets , The order of searching the header file is :

Header file path set by compiler ( The compiler can use -I Explicitly specify the search path )

System variables CPLUS_INCLUDE_PATH/C_INCLUDE_PATH Specified header file path



原网站

版权声明
本文为[it_ xiangqiang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131756277179.html