编写#import< filename.h>的区别和#import"filename.h"即将文件名写在尖括号和引号中? [英] Difference between writing #import <filename.h> and #import "filename.h" i.e written the file name in angular brackets and quotes?

查看:118
本文介绍了编写#import< filename.h>的区别和#import"filename.h"即将文件名写在尖括号和引号中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
#include< filename>之间有什么区别?和#include“文件名”

写#import和#import"filename.h"之间的区别,即在尖括号和引号中写文件名吗?

解决方案

带引号的格式该格式指示预处理程序在包含#include语句的文件的同一目录中,然后在任意目录的目录中查找include文件.包含(#include)该文件的文件.然后,预处理器将沿着/I编译器选项指定的路径进行搜索,然后沿着INCLUDE环境变量指定的路径进行搜索.

尖括号形式该形式指示预处理器首先沿着/I编译器选项指定的路径搜索包含文件,然后在从命令行进行编译时沿着INCLUDE环境变量指定的路径搜索包含文件.

来源 http://msdn.microsoft.com

Possible Duplicate:
what is the difference between #include <filename> and #include “filename”

Difference between writing #import and #import "filename.h" i.e written the file name in angular brackets and quotes?

解决方案

Quoted form This form instructs the preprocessor to look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file. The preprocessor then searches along the path specified by the /I compiler option, then along paths specified by the INCLUDE environment variable.

Angle-bracket form This form instructs the preprocessor to search for include files first along the path specified by the /I compiler option, then, when compiling from the command line, along the path specified by the INCLUDE environment variable.

Source http://msdn.microsoft.com

这篇关于编写#import&lt; filename.h&gt;的区别和#import"filename.h"即将文件名写在尖括号和引号中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆