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

📄 subject_57794.htm

📁 vc
💻 HTM
字号:
<p>
序号:57794 发表者:蠢牛 发表日期:2003-10-28 10:14:39
<br>主题:求助:菜鸟问题,关于C++
<br>内容:这个问题我不知道怎么搞哦,请大家帮忙:具体来说就是下面一段代码执行以后,本来该显示一句话,但是实际上输出的是一段数字,请看看:<BR>#include &lt;iostream&gt;<BR>using namespace std;<BR>void output1(int);<BR>void output2(int);<BR>int main ()<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; output1;<BR>&nbsp;&nbsp;cout &lt;&lt; output1;<BR>&nbsp;&nbsp;cout &lt;&lt; output2;<BR>&nbsp;&nbsp;cout &lt;&lt; output2;<BR>&nbsp;&nbsp;return(0);<BR>}<BR>void output1 (int)<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;Three blind mice&#34;;<BR>}<BR>void output2 (int)<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;see how they run&#34;;<BR>}<BR><BR>输出结果<BR>00401069004010690040106400401064P
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:楚天琪 回复日期:2003-10-28 10:18:43
<br>内容:void output1 (int)<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;Three blind mice&#34;;<BR>}<BR>void output2 (int)<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;see how they run&#34;;<BR>}<BR>这两个函数都是有形参的,而你在<BR>&nbsp;&nbsp;cout &lt;&lt; output1;<BR>&nbsp;&nbsp;cout &lt;&lt; output1;<BR>&nbsp;&nbsp;cout &lt;&lt; output2;<BR>&nbsp;&nbsp;cout &lt;&lt; output2;<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-10-28 10:25:28
<br>内容:#include &lt;iostream&gt;<BR>using namespace std;<BR>char output1 ();<BR>char output2 ();<BR>int main ()<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; output1 () &lt;&lt; &#34;\n&#34;;<BR>&nbsp;&nbsp;cout &lt;&lt; output1 ()&lt;&lt; &#34;\n&#34;;<BR>&nbsp;&nbsp;cout &lt;&lt; output2 ()&lt;&lt; &#34;\n&#34;;<BR>&nbsp;&nbsp;cout &lt;&lt; output2 ()&lt;&lt; &#34;\n&#34;;<BR>&nbsp;&nbsp;return(0);<BR>}<BR>char output1 ()<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;Three blind mice&#34;;<BR>&nbsp;&nbsp;return (0);<BR>}<BR>char output2 ()<BR>{<BR>&nbsp;&nbsp;cout &lt;&lt; &#34;see how they run&#34;;<BR>&nbsp;&nbsp;return (0);<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>
回复者:zzjhsj 回复日期:2003-10-28 10:25: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>
回复者:蠢牛 回复日期:2003-10-28 11:49:11
<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-10-28 12:37:26
<br>内容:&lt;BLOCKQUOTE&gt;引用“第3楼”所言<BR>&lt;Q&gt;输出的数字是函数的地址,不是错误&lt;/Q&gt;&lt;/BLOCKQUOTE&gt;<BR>没错亚
<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 + -