#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

转载于:https://www.cnblogs.com/simplelifestyle/p/3761920.html

C++中 #include与#include相关推荐

  1. vs2019 MFC 中 cannot open include file 'afxres.h' 问题解决方法

    vs2019 MFC 中 cannot open include file 'afxres.h' 问题解决方法 使用Everything查找afxres.h文件,如果没有everything的,可以到 ...

  2. Makefile中指示符“include”、“-include”和“sinclude”的区别

    指示符"include"."-include"和"sinclude" 如果指示符"include"指定的文件不是以斜线开 ...

  3. [转] iOS中@class #import #include 简介

    [转载自:http://blog.csdn.net/chengwuli125/article/details/9705315] 一.解析        很多刚开始学习iOS开发的同学可能在看别人的代码 ...

  4. Makefile:include和-include

    https://www.cnblogs.com/cuckoos/articles/5049984.html 使用"include FILENAMES...",make程序处理时,如 ...

  5. #include ““和#include <>区别

    在 C++ 中,使用 #include "" 和 #include <> 引入的头文件是有区别的. #include "" 会在当前源文件所在的目录 ...

  6. #include 和 #include的区别

    #include< file >编译程序会先到标准函数库中找文件 #include"file" 编译程序会先从当前目录中找文件 参考原文 转: 在C程序中包含文件有以下 ...

  7. C语言中,#include的用法:#include 和 #include区别

    C语言中,#include的用法:#include "" 和 #include<>区别 采用 " ":依次搜索当前目录.包括/I编译开关的路 ...

  8. JSP中两种include的区别

    jsp中有两种include,一种是<%@include file="xxx.jsp"%>,另一种是<jsp:include page="xxx.jsp ...

  9. C++中include 与 include 的区别

    <>时先去系统目录中找头文件,如果没有再到当前目录下找.所以像标准的头文件 stdio.h, stdlib.h等都用<>; ""则首先到当前目录下找,如果找 ...

最新文章

  1. 八叉树 java_java简单实现八叉树图像处理代码示例
  2. 放大缩小保证div对齐_GraphPad Prism 绘图教程 | 如何在图表中对齐对象
  3. HTML5的离线储存
  4. 085:QuerySet API详解-defer和only
  5. 以敏捷的方式运作一所大学
  6. lombok几个基本注解的使用@Data @AllArgsConstructor @NoArgsConstructor @Builder
  7. 360压缩加密压缩文件
  8. linux防ddos攻击脚本,Linux系统防止DDOS攻击脚本
  9. vue2练习五个小例子笔记
  10. vue引入腾讯地图,去除水印
  11. 腾讯云OCR(印刷体识别) API使用
  12. 开启Mac的壁纸自动更换功能
  13. 转 FTP搜索引擎的设计与实现(优化版)
  14. 十进制怎样转二进制?
  15. Mac pro 突然没有办法按住shift打出大写S
  16. 想升职?不妨和老板争一争!
  17. 高频故障-文件扩展名消失(windows)
  18. Win11 没有磁盘清理工具,如何清理磁盘旧的windows.old文件
  19. 非常牛逼的校园网过认证免流服务器
  20. C语言 有符号类型转换为无符号类型

热门文章

  1. 2010年8月和9月成果
  2. 10g 中RETENTION GUARANTEE 的作用
  3. xss跨站脚本,纯安全测试干货分享-建议收藏
  4. ngnix服务器搭建
  5. 如何有效地记录 Java SQL 日志(转)
  6. 扩展KMP --- HDU 3613 Best Reward
  7. an unsupported operation was attempted问题解决
  8. Cocos2d-x项目开发时在Eclipse中配置环境编译C++
  9. 随手小记 才知道系列
  10. Java网络编程从入门到精通(14):多种多样的建立网络连接的方式