<>先去系统目录中找头文件,如果没有在到当前目录下找。所以像标准的头文件 stdio.h、stdlib.h等用这个方法。

而""首先在当前目录下寻找,如果找不到,再到系统目录中寻找。 这个用于include自定义的头文件,让系统优先使用当前目录中定义的。

When writing your C program, you can include files in two ways. The first way is to surround the file you want to include with the angled brackets < and >. This method of inclusion tells the preprocessor to look for the file in the predefined default location.

This predefined default location is often an INCLUDE environment variable that denotes the path to your include files. For instance, given the INCLUDE variable

  1. INCLUDE=C:COMPILERINCLUDE;S:SOURCEHEADERS;

using the #include  version of file inclusion, the compiler first checks the C:COMPILERINCLUDE 
directory for the specified file. If the file is not found there, the compiler then checks the S:SOURCEHEADERS directory. If the file is still not found, the preprocessor checks the current directory.

The second way to include files is to surround the file you want to include with double quotation marks. This method of inclusion tells the preprocessor to look for the file in the current directory first, then look for it in the predefined locations you have set up.

Using the #include &ldquo;file&rdquo; version of file inclusion and applying it to the preceding example, the preprocessor first checks the current directory for the specified file. If the file is not found in the current directory, the C:COMPILERINCLUDE directory is searched. If the file is still not found, the preprocessor checks the S:SOURCEHEADERS directory.

    • The #include  method of file inclusion is often used to include standard headers such as stdio.h or stdlib.h. This is because these headers are rarely (if ever) modified, and they should always be read from your compiler&rsquo;s standard include file directory.
    • The #include &ldquo;file&rdquo; method of file inclusion is often used to include nonstandard header files that you have created for use in your program. This is because these headers are often modified in the current directory, and you will want the preprocessor to use your newly modified version of the header rather than the older, unmodified version.

最新文章

  1. C#数据结构选择
  2. Linux Buffer I/O error on device dm-4, logical block
  3. strtol,strtoll,strtoul, strtoull字符串转化成数字
  4. STL的string和wstring
  5. Exchange 2013 、Lync 2013、SharePoint 2013 二
  6. 《OD大数据实战》HDFS入门实例
  7. vim编程 插入 保存不退出 保存退出 退出不保存 另存为其他文件名 保存覆盖现有文件
  8. 【web安全】第三弹:web攻防平台pentester安装及XSS部分答案解析
  9. django HttpRequest
  10. devexpress中用ChartControl生成柱状图
  11. 详解js和jquery里的this关键字
  12. Eviews 9.0新版本新功能——预测(Auto-ARIMA预测、VAR预测)
  13. HashMap 和 ConcurrentHashMap比较
  14. bower 安装后 jade 引用404问题
  15. 《Linux内核设计与实现》Chapter 2 读书笔记
  16. 获取异常信息e.printStackTrace()的内容
  17. 你知道吗, CoreGraphics绘图系统和Bezier贝塞尔曲线坐标系的顺时针方向是相反的!
  18. MySQL:PyMySQL&amp;ORM
  19. appium实现adb命令 截图和清空EditText
  20. 继承Application管理生命周期

热门文章

  1. 搭建MAC下vim环境
  2. 与平台无关的类型,int8_t,uint8_t
  3. MySQL PLSQL Demo - 002.变量定义、赋值
  4. Oracle PLSQL Demo - 18.01管道function[查询零散的字段组成list管道返回]
  5. 异常处理:1215 - Cannot add foreign key constraint
  6. 将socket通信变成并发的方式
  7. maven install 跳过test方法
  8. iOS NSURLConnection使用详解
  9. jQuery 选择器大全总结
  10. [mmc]设备树节点含义