标题:错在哪里请指点
取消只看楼主
gxl1127
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-6-12
结帖率:66.67%
 问题点数:0 回复次数:1 
错在哪里请指点

今天从网上下的VC6.0,装好后用一段代码去测试,结果出错了.
代码是:
#include<stdio.h>
{
printf("Hello World\n");
}

出错提示:
--------------------Configuration: hello - Win32 Debug--------------------
Compiling...
hello.c
G:\C\hello\hello.c(2) : error C2449: found '{' at file scope (missing function header?)
G:\C\hello\hello.c(4) : error C2059: syntax error : '}'
Error executing cl.exe.

hello.exe - 2 error(s), 0 warning(s)

这是怎么回事啊?是我哪儿没做好?请指点,万分感谢!

搜索更多相关主题的帖子: function include warning hello 
2007-06-12 23:21
gxl1127
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-6-12
得分:0 

原来是少了void main()
谢谢高手们的指点

2007-06-12 23:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-146932-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.212536 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved