⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_28074.htm

📁 vc
💻 HTM
字号:
<p>
序号:28074 发表者:曦 发表日期:2003-01-17 16:54:10
<br>主题:请问#include "" 和 #include &lt;&gt;的区别?
<br>内容:我记得书上说<BR>#include "iostream.h"和#include &lt;iostream.h&gt;是一样的。<BR>但是我在VC中用这个时却发现一个问题。我自己建立了一个string1.h和string1.cpp,在string1.cpp中用了#include "string1.h",但是用#include &lt;string1.h&gt;却不可以,这是为什么?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:不败的石头 回复日期:2003-01-17 17:01:17
<br>内容:C标准类库里面的头文件可以用&lt;&gt;或"",自定义的只能用""
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:在水一方 回复日期:2003-01-17 17:03:54
<br>内容:仔细阅读<BR>&nbsp;&nbsp; If the file is in the current directory, the string must be enclosed in double quotation marks(双引号); if the file is in the directory specified by the INCLUDE environment variable, the string must be enclosed in less-than and greater-than characters (&lt;&gt;). You must give a full path enclosed in double quotation marks (") if the file is not in the current directory or in the directory specified by the INCLUDE environment variable. <BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:梨子 回复日期:2003-01-17 17:07:07
<br>内容:下载一份&lt;&lt;高质量c++/c 编程指南&gt;&gt;,在http://www.mcu51.com/主页上有<BR>好好读一下,里面讲得很清楚。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:晚风也渡 回复日期:2003-01-17 21:52:12
<br>内容:#include "*.h"和 #include &lt;*/*.h&gt;的区别<BR>&nbsp;&nbsp; 二者的区别是用尖括弧时,系统到存放C库函数头文件所在的目录中寻找要包含的文件,这称为标准方式。用双撇号时,系统先在用户当前目录中寻找要包含的文件,若找不到,要按标准方式查找(即再按尖括号的方式查找)。一般说,如果为调用库函数而用#include命令来包含相关的头文件,则用尖括号,以节省查找时间。如果要包含的是用户用自己编写的文件{这种文件一般都在当前目录中},一般用双撇号。若文件不在当前目录中,双撇号内可给出文件路径。<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:coolcoolfoot 回复日期:2003-01-17 23:23:21
<br>内容:#include ""和#include &lt;&gt;他们查找头文件时所用的默认路径是不同的。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -