liveBook · Manning

Exit

exit is a standard-library function that terminates normal program execution after performing required termination processing, without ordinarily unwinding active automatic objects.

How 2 Manning books explain it

Modern C, Third Edition

exit is a C standard-library function that terminates normal program execution and performs implementation-defined cleanup for the process.

How it is used
Terminates normal control flow from a function and communicates program success or failure to the runtime system.
How deep it goes
Defines termination equivalence, nonreturning behavior, status values, cleanup, and error-handling use, but not detailed handler mechanics.
Examples
Uses failed puts output, perror diagnostics, EXIT_FAILURE, and the exit prototype as concrete examples.
What you can do after
Apply it to terminate from nested control flow after diagnosing an unrecoverable library failure.

Read how Modern C, Third Edition explains exit →

Modern C

exit is the C standard library function that terminates normal program execution after performing the standard termination processing.

How it is used
Uses exit to terminate normal control flow from functions other than main.
How deep it goes
Defines the prototype, status equivalence, nonreturning behavior, and cleanup implications, but defers implementation details.
Examples
Shows exit declarations, main status handling, and an atexit cleanup handler that reports termination.
What you can do after
Apply it to terminate execution from a nested function while communicating success or failure and preserving normal cleanup.

Read how Modern C explains exit →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.