Hello World

作者在 2011-07-27 16:37:12 发布以下内容
# include <stdio.h>

int main(void)
{
    printf("今天开始从头学习C语言!要加油哦!\n");

    return (0);
}
默认分类 | 阅读 1500 次
文章评论,共13条
BNV
2011-08-06 13:59
1
return的用法还不是很明白,为什么要加return(0);???
edwardflee(作者)
2011-08-08 09:21
2
<div class="quote"><span class="q"><b>BNV</b>: return的用法还不是很明白,为什么要加return(0);???</span></div>这个我暂时也还没学到呢,只是按照老师提供的模板再敲代码,而且好像当时抄的也不对,老师用的是return 0,没有加括号。准备继续学,看看后面会不会讲到这个问题<img src="image/face/22.gif" class="face">
従箂
2011-08-08 17:50
3
<div class="quote"><span class="q"><b>BNV</b>: return的用法还不是很明白,为什么要加return(0);???</span></div>其实不加也可以的,我是菜鸟,原因自己找。
wangjin0620
2011-08-10 17:18
4
return是用来终止一个函数并返回其后面跟着的值。在这个函数里,return可有可无的。
edwardflee(作者)
2011-08-11 08:45
5
谢谢上面两位朋友指教,欢迎常来哦<img src="image/face/2.gif" class="face">
xudaleihao
2011-08-12 08:53
6
养成用return的习惯,当以后程序比较多的时候,不容易出错,不如返回某个函数运算值。
空军一号1号
2011-08-12 23:02
7
#include&lt;stdio.h&gt;<br />
int main(void)<br />
{<br />
&nbsp; &nbsp;&nbsp;&nbsp;printf(&quot;祝你好运\n&quot;);<br />
}
edwardflee(作者)
2011-08-13 09:48
8
<div class="quote"><span class="q"><b>空军一号1号</b>: #include&lt;stdio.h&gt;<br />
int main(void)<br />
{<br />
&nbsp; &nbsp;&nbsp;&nbsp;printf(&quot;祝你好运\n&quot;);<br />
}</span></div><img src="image/face/22.gif" class="face">
八画小子
2011-08-18 18:26
9
我很高兴,你的第一步是对的。很多新手写出的第一个程序都是Hello World程序。这个程序虽然简单,但却给出了C语言的大体全貌。很多新手都没有很好得学习这个程序,导致以后的代码中时常有错。下面写个有问题的代码供你看看,虽然可能能够编译通过,但却不符合标准。<br />
void main()<br />
{<br />
<br />
}
八画小子
2011-08-18 18:27
10
void main()<br />
{<br />
&nbsp; &nbsp;printf(&quot;hello world!&quot;);<br />
}<br />
<br />
main()<br />
{<br />
&nbsp; &nbsp;printf(&quot;hello world!&quot;);<br />
}
zzgtjt
2011-08-25 16:11
11
&lt;%<br />
&nbsp; &nbsp; out.println(&quot;祝贺你好运&quot;);<br />
&nbsp; &nbsp; if(您进我的空间)<br />
&nbsp; &nbsp;&nbsp; &nbsp;out.println(&quot;i'll&nbsp; &nbsp;make a message &quot;);<br />
%&gt;
edwardflee(作者)
2011-08-25 16:33
12
<div class="quote"><span class="q"><b>八画小子</b>: void main()<br />
{<br />
&nbsp; &nbsp;printf(&quot;hello world!&quot;);<br />
}<br />
<br />
main()<br />
{<br />
&nbsp; &nbsp;printf(&quot;hello world!&quot;);<br />
}</span></div>呵呵,之前是抄视频上老师的代码。这两天才刚学到函数的定义,才略微明白一点
edwardflee(作者)
2011-08-25 16:34
13
<div class="quote"><span class="q"><b>zzgtjt</b>: &lt;%<br />
&nbsp; &nbsp; out.println(&quot;祝贺你好运&quot;);<br />
&nbsp; &nbsp; if(您进我的空间)<br />
&nbsp; &nbsp;&nbsp; &nbsp;out.println(&quot;i'll&nbsp; &nbsp;make a message &quot;);<br />
%&gt;</span></div>嘻嘻,去拜访过了,这是什么语言啊?
游客请输入验证码
最新评论