error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘_attribute_’ before ‘{’ token,该如何处理

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)

C/C++ code

#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World ...\n");
return 0;
}


再精简也写个"main()"吧,不要连括号都省。

error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘_attribute_’ before ‘{’ token,该如何处理

相关文章:

你感兴趣的文章:

标签云: