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)都是把把包含的文件代码读入到指定位置来,但是二者再用法上有区 ...
随机推荐
- GCC精彩之旅_1
说明: 本文共两篇,转自GCC精彩之旅.第一篇着重介绍GCC编译一个程序的过程与优化,第二篇侧重在GCC结合GDB对代码的调试. 在为Linux开发应用程序时,绝大多数情况下使用的都是C语言,因此几乎 ...
- 洛谷P3796 - 【模板】AC自动机(加强版)
原题链接 Description 模板题啦~ Code //[模板]AC自动机(加强版) #include <cstdio> #include <cstring> int co ...
- JavaScript将小写金额转换成大写
//num为小写金额,单位元 changeMoney(num) { if(isNaN(num))return ""; var strPrefix=""; if( ...
- Python+Selenium基础篇之1-环境搭建
Python + Selenium 自动化环境搭建过程 1. 所需组建 1.1 Selenium for python 1.2 Python 1.3 Notepad++ 作为刚初学者,这里不建议使用P ...
- flask项目开发中,遇到http 413错误
在flask项目中,上传文件时后台报http 413 Request Entity Too Large 请求体太大错误! 解决的2种方法: 1.在flask配置中设置 MAX_CONTENT_LENG ...
- java-数据库连接,分层实现增删改查测试
成员属性类: public class Dog { private int number; private String name; private String strain; private St ...
- 使用java实现阿里云消息队列简单封装
一.前言 最近公司有使用阿里云消息队列的需求,为了更加方便使用,本人用了几天时间将消息队列封装成api调用方式以方便内部系统的调用,现在已经完成,特此记录其中过程和使用到的相关技术,与君共勉. 现在阿 ...
- js 滚动到一定位置导航定位在页面最顶部
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- nimi SearchEngin 项目思路及算法
最近做一个轻量文本搜索项目,在项目实行过程中,如果使用余弦求网页相似度,不能适应海量网页查重.看了那本<这就是搜索引擎 核心技术详解>后,对simhash算法有一定的理解,并且喜欢上了这 ...
- 嵌入式Linux引导过程之1.5——从BootRom到Xloader
在开始看Xloader_Entry的代码之前,我想先总结一下从芯片上电到开始运行Xloader的代码的过程,这是我目前理解的一个过程,可能有所出入,待以后继续完善. 当 系统上电之后,首先会将PC寄存 ...