错在哪里请指点
今天从网上下的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)
这是怎么回事啊?是我哪儿没做好?请指点,万分感谢!
----------------解决方案--------------------------------------------------------
#include<stdio.h>
int main (void)
{
printf("Hello World\n");
}
----------------解决方案--------------------------------------------------------
----------------解决方案--------------------------------------------------------
原来是少了void main()
谢谢高手们的指点
----------------解决方案--------------------------------------------------------
.................
----------------解决方案--------------------------------------------------------
......................................
----------------解决方案--------------------------------------------------------
.......还有这帖子
----------------解决方案--------------------------------------------------------
这个大哥和我差不多,加油了
----------------解决方案--------------------------------------------------------
----------------解决方案--------------------------------------------------------