"exit 0;" - or - "exit (0);" ?
Ron Natalie <ron>
ron at brl-sem.ARPA
Tue Nov 18 10:54:16 AEST 1986
In article <331 at cartan.Berkeley.EDU>, ballou at brahms (Kenneth R. Ballou) writes:
> In article <1512 at batcomputer.tn.cornell.edu> braner at batcomputer.UUCP (braner) writes:
> >While K&R explicitly say that exit() is a function, I commonly see
> >the parens dropped. Is that "legal"? Does it work on existing compilers?
>
> Note that 'exit' is not a reserved word in (K&R) C. Therefore, the
> compiler should reject the construct exit 0; on at least two grounds.
Perahps this poor soul is getting exit confused with return. Return
does not require parentheses. Exit in every implementation that I have
seen is indeed a function and requires "()" as a minimum.
-Ron
More information about the Comp.lang.c
mailing list