liveBook · Manning

Atexit

atexit is a C standard-library function that registers a function to execute during normal program termination.

How 2 Manning books explain it

Modern C, Third Edition

atexit is a C standard-library function that registers a function to be called during normal program termination.

How it is used
Registers cleanup code for normal program termination.
How deep it goes
Defines registration and function-reference syntax, but deliberately omits detailed handler mechanics.
Examples
Demonstrates a sayGoodBye handler that reports errors and writes a farewell message.
What you can do after
Apply atexit to register memory cleanup or termination logging before normal program completion.

Read how Modern C, Third Edition explains atexit →

Modern C

atexit is the C standard library function that registers a function to be called during normal program termination.

How it is used
Registers cleanup or reporting code for normal program termination.
How deep it goes
Defines registration syntax and behavior through one example, but defers detailed function-parameter mechanics.
Examples
Uses a sayGoodBye handler that checks errno, reports errors, writes to stderr, and represents cleanup work.
What you can do after
Apply it by registering a no-argument handler for cleanup or status reporting during normal termination.

Read how Modern C explains atexit →

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.