exit---end program execution
#include <stdlib.h> void exit(int code);
exit to return control from a program to the host operating
environment. Use the argument code to pass an exit status to the
operating environment: two particular values,
EXIT_FAILURE, are defined in `
stdlib.h' to indicate success or
failure in a portable fashion.
exit does two kinds of cleanup before ending execution of your
program. First, it calls all application-defined cleanup functions
you have enrolled with
atexit. Second, files and streams are
cleaned up: any pending output is delivered to the host system, each
open file or stream is closed, and files created by
exit does not return to its caller.
ANSI C requires
exit, and specifies that
EXIT_FAILURE must be defined.
Supporting OS subroutines required:
Go to the first, previous, next, last section, table of contents.