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

📄 subject_53539.htm

📁 vc
💻 HTM
字号:
<p>
序号:53539 发表者:yiguozhen 发表日期:2003-09-20 15:45:29
<br>主题:学习《c++编程思想》书中碰到一个菜鸟问题,请各位大哥不吝赐教!!!!
<br>内容:在学《c++编程思想》时,(机械工业出版社的翻译作品),其中,本书作者自己在书中编的头文件#include &#34;../require.h&#34;在书中找不源代码,各位大哥如果知道的请告诉我 好吗?这个头文件不知道,很多程序就运行不了 !请各位大哥、高手们帮帮忙啊!谢谢!<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:yiguozhen 回复日期:2003-09-20 15:58:59
<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>
回复者:lijb 回复日期:2003-09-20 16:05:12
<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>
回复者:yiguozhen 回复日期:2003-09-20 16:12:45
<br>内容:to:Lijib<BR>&nbsp;&nbsp; 谢谢你的提醒,我已经在书上仔细找过了 ,可是,找不到源代码。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:a dog 回复日期:2003-09-20 16:26:05
<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>
回复者:yiguozhen 回复日期:2003-09-20 16:34:23
<br>内容:to:gww<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;谢谢你的提醒,我那本书是在图书馆借的,所以没有附带光盘,以后有机会我会去看看的。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:yiguozhen 回复日期:2003-09-21 11:35:38
<br>内容:有没有人帮帮我啊,我快急死了<BR><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-09-21 18:09:52
<br>内容:英文书在P396,也是在线函数(Inline Function)那里
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:yiguozhen 回复日期:2003-09-21 21:54:05
<br>内容:在这里我要感谢第六楼的水番大哥,非常感谢!<BR>顺便说一下:我最近也刚好在看在先函数inline function那一章了,<BR>可是我没认真看,要不然,我也可以自己找到的。哈哈。<BR>再次感谢水番大哥细心的帮我查找!!!<BR>正确答案如下:<BR>//::require.h<BR>//Test for error conditions in programes<BR>//Local &#34;using namespace std&#34;for old comilers<BR>#ifndef REQUIRE_H<BR>#define REQUIRE_H<BR>#include &lt;scstdio&gt;<BR>#include&lt;cstdlib&gt;<BR>#include&lt;fstream&gt;<BR>#include&lt;string&gt;<BR><BR>inline void require(bool requirement,<BR>&nbsp;&nbsp;const std::string&amp; msg =&#34;Requirement failed&#34;) {<BR>&nbsp;&nbsp;using namespace std;<BR>&nbsp;&nbsp;if (!requirenemt) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;fputs(msg.c_str(),stderr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;fputs(&#34;\n&#34;,stderr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit(1);<BR>&nbsp;&nbsp;}<BR> }<BR><BR>inline void requireArgs(int argc,int args,<BR> const std::string&amp; msg=<BR> &#34;Must use %d arguments&#34;)&nbsp;&nbsp;{<BR> using namespace std;<BR>&nbsp;&nbsp;if(argc!=args+1) {<BR>&nbsp;&nbsp; fprintf(stderr,msg.c_str(),srgs);<BR>&nbsp;&nbsp; fputs(&#34;\n&#34;,stderr);<BR>&nbsp;&nbsp; exit(1);<BR>&nbsp;&nbsp; }<BR> }<BR>inline void requireMinArgs(int argc,int minArgs,<BR> const std::string&amp; msg=<BR>&nbsp;&nbsp;&#34;Must use at least %d arguments&#34;) {<BR> using namespace std;<BR> if(argc&lt;minArgs+1) {<BR>&nbsp;&nbsp; fprintf(stderr,msg.c_str(),minArgs);<BR>&nbsp;&nbsp; fputs(&#34;\n&#34;,stderr);<BR>&nbsp;&nbsp; exit(1);<BR>&nbsp;&nbsp;}<BR>}<BR><BR>inline void assure(std::ifstream&amp; in,<BR>&nbsp;&nbsp;const std::string&amp; filename=&#34; &#34;){<BR>&nbsp;&nbsp;using namespace std;<BR>&nbsp;&nbsp;if(!in) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;fprintf(stderr,&#34;Could not open file %s\n&#34;,<BR>&nbsp;&nbsp;&nbsp;&nbsp; filename.c_str());<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit(1);<BR>&nbsp;&nbsp;}<BR> }<BR><BR>inline void assure (std::ofstream&amp; out,<BR> const std::string&amp; filename=&#34; &#34;) {<BR> if(!out) {<BR>&nbsp;&nbsp;fprintf(stderr,&#34;Could not open file %s\n&#34;,<BR>&nbsp;&nbsp;&nbsp;&nbsp;filename.c_str());<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit(1);<BR>&nbsp;&nbsp;}<BR> }<BR>#endif//REQUIRE_H///:~ <BR>再次感谢水大哥!!<BR>谢谢!<BR>以后多联系<BR>-----------------------------------签-----名---------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;爱一个人不在乎她有多丑,&nbsp;&nbsp; 做一件事不在乎它有多难!<BR><BR><BR><BR><BR>2003-9-21 21:57:19

⌨️ 快捷键说明

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