Mail Archives: djgpp/1997/02/25/03:11:06
Zaphod Beeblebrox wrote:
> I'm still really new to C/C++, but I was on a good steady track using the
> Personal C Compiler from C WARE. The general syntax I'm used to doesn't
> apply in GCC. Here is what I'm used to:
>
> main();
> {
> puts("Hello World.");
> return(0);
> }
>
> Why won't this compile?
You have an extraneous semicolon at the end of your definition of the
function main. What the compiler thinks you're doing based on your bad
syntax is declaring a prototype for function main, and then starting a
block that isn't part of any function.
> I get an unusual parser error at the first {.
> How do I fix this?
Remove the semicolon.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -