[LCP]Why do I do this? or exit() vs. return
Vincent Penquerc'h
Vincent.Penquerch at artworks.co.uk
Thu Jul 10 17:20:01 UTC 2003
> I would stick to using exit because at some
> latter point the programmers may start using
> atexit and on_exit, and if this happens you
> won't have to modify the code.
Falling off main or returning from it will call
any atexit registered routines.
> Beware of the differences between exit and
> _exit aswell.
But not when calling _exit (or abort, or when slapped
with a fatal signal, etc).
--
Vincent Penquerc'h
More information about the linuxCprogramming
mailing list