Mail Archives: djgpp/1997/07/09/04:02:52
Shawn Hargreaves wrote:
> James Edwin Cooper writes:
> >main()
>
> Pedantic point: that should be 'int main()', and you should put a
> 'return 0;' at the end of the program...
Let's not be so pedantic that we miss the fact that an unspecified return
type defaults to int (this is ANSI), even though it's considered bad style
(where this is not the appropriate place to nitpick about that, because it
varies from person to person). The only thing he was missing was a return
statement returning a value at the end of the function.
> You probably got a couple of warnings while compiling that, though? If
> not you should put -Wall on your gcc command line, so it will warn you
> about calls to unprototyped functions. You should include stdio.h and
> conio.h to get rid of those warnings, after which you'll get an error
> for the incorrect call to getche().
getche is in conio.h, not stdio.h. It is in fact non-ANSI.
--
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
\
"All the gods are dead / except the god of war."
/ Eldridge Cleaver
- Raw text -