当前位置: 技术问答>linux和unix
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
来源: 互联网 发布时间:2017-03-16
本文导语: hello.c code: #include void main { printf("hello work!"); } compile:$ cc helloWork.c helloWork.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token why?? | 我晕 main 后面没有括号啊 ...
hello.c code:
#include
void main
{
printf("hello work!");
}
compile:$ cc helloWork.c
helloWork.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
why??
#include
void main
{
printf("hello work!");
}
compile:$ cc helloWork.c
helloWork.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
why??
|
我晕 main 后面没有括号啊
|
main的括号呢?
|
int man(void)
|
#include
int main(int argc, char *argv[])
{
printf("Hello World ...n");
return 0;
}
|
再精简也写个"main()"吧,不要连括号都省。