| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 448 人关注过本帖
标题:错在哪里请指点
取消只看楼主 加入收藏
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
快速回复:错在哪里请指点
数据加载中...
 
   



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

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