C++中 #include<>与#include""
#include<>
使用尖括号表示在包含文件目录中去查找(包含目录是由用户在设置环境时设置的),而不在源文件目录去查找;
#include""
使用双引号则表示首先在当前的源文件目录中查找,若未找到才到包含目录中去查找;
MSDN的相关说明
#include""
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.
#include<>
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.
扩展知识
1.
Q:C++中的预处理#include<iostream>和#include<iostream.h>对程序的运行有什么不同?
A:没有区别
2.
Q:#include<iostream>后加using namespace std; 和直接用#include<iostream.h>在运行上有什么区别?
A:#include<iostream.h>是早些时候的形式
最新的标准定义的是
#include<iostream>
using namespace std;
比如#include<math.h>变成
#include<cmath>
using namespace std;
#include<string.h>变成
#include<cstring>
using namespace std;
from:http://blog.csdn.net/xiaoting451292510/article/details/12562363
C++中 #include<>与#include""的更多相关文章
- JSP中编译指令include与动作指令include的区别
include指令是编译阶段的指令,即include所包含的文件的内容是编译的时候插入到JSP文件中,JSP引擎在判断JSP页面未被修改, 否则视为已被修改.由于被包含的文件是在编译时才插入的,因此如 ...
- jsp中两种include的区别【转】
引用文章:http://www.ibm.com/developerworks/cn/java/j-jsp04293/ http://www.cnblogs.com/lazycoding/archive ...
- 在html中注释对 <include XXXXXXXX />是没有影响的
在html中注释对 <include XXXXXXXX />是没有影响的
- Makefile中指示符“include”、“-include”和“sinclude”的区别
转:http://www.cnblogs.com/xmphoenix/archive/2012/02/22/2363335.html 指示符“include”.“-include”和“sinclude ...
- jsp中的包含 include标签和ejb的小知识点
<!-- 用inclue指令导入安全登录防护代码(静态包含) --> <!-- 静态包含:把被包含代码拷到当前类中形成一个新的类,执行.包含与被包含代码是合写在同一个类(servic ...
- Makefile中include、-include、sinclude的区别
如果指示符“include”指定的文件不是以斜线开始(绝对路径,如/usr/src/Makefile...),而且当前目录下也不存在此文件:make将根据文件名试图在以下几个目录下查找:首先,查找使用 ...
- ※C++随笔※=>☆C++基础☆=>※№→C++中 #include<>与#include""
#include<> 使用尖括号表示在包含文件目录中去查找(包含目录是由用户在设置环境时设置的),而不在源文件目录去查找: #include"" 使用双引号则表示首先在 ...
- iOS中@class #import #include 简介
[转载自:http://blog.csdn.net/chengwuli125/article/details/9705315] 一.解析 很多刚开始学习iOS开发的同学可能在看别人的代码 ...
- PHP中require和include的区别
include()与require()的功能相同 include(include_once) 与 require(require_once)都是把把包含的文件代码读入到指定位置来,但是二者再用法上有区 ...
随机推荐
- Mybatis学习之道(一)
本例子为采用的mysql+maven+mybatis构建. 初步学习mybatis: mybatis为一个半自动框架,相对于hibernate来说他更加轻巧,学习成本更低. 1.新建一个maven工程 ...
- [翻译] .NET Core 2.1 Preview 1 发布
[翻译] .NET Core 2.1 Preview 1 发布 原文: Announcing .NET Core 2.1 Preview 1 今天,我们宣布发布 .NET Core 2.1 Previ ...
- java6 - 面向对象编程思想
一.学习大纲: 1. 类的理解:对现实事物的抽象表示 2. 行为与特征的理解:在类抽象过程中,通常把行为抽象成方法,把特征抽象成属性 3. 对象的理解:类的一个实例即是对象 4. Object 根类 ...
- Node.js的下载、安装、配置、Hello World、文档阅读
Node.js的下载.安装.配置.Hello World.文档阅读
- Linux下yum安装MysqL数据库
1.命令安装mysql # yum install mysql mysql-server mysql-devel -y 最后提示 Complete! 表示安装成功 2.查看是否生成了mysqld服务 ...
- hibernate框架基础描述
在hibernate中,他通过配置文件(hibernate,cfg.xml)和映射文件(...hbm.xml)把对象或PO(持久化对象)映射到数据库中表,然后通过操作持久化对象,对数据库进行CRUD. ...
- python开发【第一篇】
内容编码 python解释器在加载.py文件的时候,会对内容进行编码(默认是ascii编码). ASCII 是基于拉丁系统的一套电脑编码系统, 主要用于显示现代英语和其他西欧语言,其最多只能用8位来表 ...
- HDP2.0.6+hadoop2.2.0+eclipse(windows和linux下)调试环境搭建
花了好几天,搭建好windows和linux下连接HDP集群的调试环境,在此记录一下 hadoop2.2.0的版本比hadoop0.x和hadoop1.x结构变化很大,没有eclipse-hadoop ...
- Git 版本退回commit
有的时候错误提交了commit,需要版本退回. 先用git log查看一下节点版本号commit_id $ git log 再用git reset退回 $ git reset -soft commit ...
- Struts+Spring+Hibernate、MVC、HTML、JSP
javaWeb应用 JavaWeb使用的技术,比如SSH(Struts.Spring.Hibernate).MVC.HTML.JSP等等技术,利用这些技术开发的Web应用在政府项目中非常受欢迎. 先说 ...