日期:2014-05-16  浏览次数:20830 次

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()"吧,不要连括号都省。