From: Eli Z. <el...@gn...> - 2012-04-20 10:53:39
|
> Date: Fri, 20 Apr 2012 12:44:37 +0200 > From: "Ji...@t-..." <Ji...@t-...> > > #include <stdio.h> > > int main { > printf("hello world n"); > return 0; > } > > However, I am getting error messages following the command "gcc > hello.c -o hello" as detailed below: > > C:UsersZBADocumentsWenzhong JiangPrgs>gcc hello.c -o hello > hello.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '{' token The compiler expects an argument list after the name of the function ('main', in this case). Like this: int main (int argc, char *argv[]) { or like this: int main (void) { or like this: int main () { The list of arguments in parentheses _must_ be there, although it could be empty. P.S. I suggest to get a good book on C and copy your first program from there verbatim. |