Mike <> writes:
> i'm playing round with more child process code.
>
> this is a program straight from my textbook:
>
> void main(argv, argc)
> int argc; char *argv[];
> {
[...]
What textbook are you using? The use of the old-style function
definition is excusable if it's a very old book; in that case, you
should get a newer one if at all possible. But the use of void as the
return type of main, though it's a common error, is harder to
understand. The "void" keyword was introduced in the 1989 ANSI C
standard -- the very same document that established the requirement
that main returns int. "void main" has *never* been correct.
(Quibble: an implementation is allowed to accept forms of main other
than the two presented in the standard -- but no implementation is
required to do so, and *all* hosted implementations must support "int
main(void)" and "int main(int argc, char *argv[])".)
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"