c/c++中#include <>与#include""区别
来源:互联网 发布:电子商务网站域名 编辑:程序博客网 时间:2024/05/27 02:28
原文:http://kooyee.iteye.com/blog/340846
<>先去系统目录中找头文件,如果没有在到当前目录下找。所以像标准的头文件 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
- 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 “file” 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’s standard include file directory.
- The #include “file” 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.
0 0
- c/c++中#include 与#include " "区别
- c/c++中#include 与#include " "区别
- c/c++中#include 与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- c/c++中#include <>与#include""区别
- C语言中include与include"file"的区别
- C语言:#include <>与#include ””的区别
- c语言中include "" 与 <>的区别
- c语言中include<>与“”的区别
- C语言中,#include的用法:#include "" 和 #include<>区别
- include *.c与 include *.h
- C/C++语言中,#include <>和#include ""的区别
- C语言中,#include<>和#include" "的区别
- 阿里要走102年,阿里的工程师能走多远呢?
- 联想Y470 非虚拟机安装苹果Mac OS X Mavericks 10.9.1教程详解(文字+图片),通俗易懂亲自动手——序列三之安装过程,设置选项
- swap函数
- Andriod 将图片截取为圆角图片
- Java中null和""的疑问
- c/c++中#include <>与#include""区别
- 【Java编程】Eclipse快捷键
- 黑马程序员——Java学习笔记之12——已接触的“设计模式”总结
- 文件的显示与下载
- 项目计划书
- Camera硬件结构组成
- 程序1.3 加权快速合并算法
- 天堂的忏悔
- 真正让我们学会建站需要凭借三大因素,当你具备了这三个因素学会建站指日可待