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

braner braner at batcomputer.tn.cornell.edu
Fri Nov 21 05:44:01 AEST 1986


In article <6355 at alice.UUCP> ark at alice.UUCP writes:
>"exit 0;" is illegal -- exit is a function just like any other.  I am sure
>you are mistaken when you say you've seen it many times.  In fact, I
>strongly suspect you are confusing it with "return 0;" which is legal C.

Actually, I now think that what I've seen was "return n;" in main(),
which I guess has the same effect as exit(n); - or does it?

BTW: Is it necessary to free() all the malloc()ed stuff before you exit()?
(I know that is OS-dependent.  What are peoples' experiences?)

- Moshe Braner



More information about the Comp.lang.c mailing list