I could not even assemble a simple Hello World program today
, must be too tired. I kept getting the error
parse error before `('
`main' declared as function returning a function
The answer should of course be to use curly braces { } on lines 3 and 6
Wrong
C:
-
#include <stdio.h>
-
int main (void)
-
(
-
return 0;
-
)
$ gcc -c -o test2.o test2.c --save-temps
test2.c:4: parse error before `('
test2.c:4: `main' declared as function returning a function
Right
C:
-
#include <stdio.h>
-
int main (void)
-
{
-
return 0;
-
}
$ gcc -c -o test2.o test2.c --save-temps
$ echo $?
0

