error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
hello.c code:
#include<stdio.h>
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 <stdio.h>int main(int argc, char *argv[]){ printf("Hello World ...\n"); return 0;}
[解决办法]
再精简也写个"main()"吧,不要连括号都省。