"exit 0;" - or - "exit (0);" ?

Ken Thompson thomps at gitpyr.gatech.EDU
Wed Nov 19 00:52:32 AEST 1986


In article <1512 at batcomputer.tn.cornell.edu>, braner at batcomputer.tn.cornell.edu (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?

exit must be a function in C. However,

                             exit 0;

is legitimate Bourne shell syntax. Is it possible that you have seen this
in a shell script not a C program ?


-- 
Ken Thompson  Phone : (404) 894-7089
Georgia Tech Research Institute
Georgia Insitute of Technology, Atlanta Georgia, 30332
...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!thomps



More information about the Comp.lang.c mailing list