Name
exit function — Terminates the program normally
Synopsis
void exit(int code)
The exit
function
terminates the program normally. Automatic objects are not
destroyed, but static objects are. Then, all functions registered
with atexit
are called in the
opposite order of registration. The code
is returned to the operating system.
An exit code of 0
or EXIT_SUCCESS
means successful completion.
If code is EXIT_FAILURE
, an
indication of program failure is returned to the operating system.
Other values of code
are
implementation-defined.
See Also
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.