February 2020
Beginner to intermediate
616 pages
15h 16m
English
Our first recipe will be to register a function that executes automatically when a program terminates normally. For this recipe, we will be using the atexit() function.
The atexit function is set to point to a function; this function is automatically called without arguments when the program terminates. If more than one atexit function is defined in a program, then these functions will be called in the Last In, First Out (LIFO) order, that is, the function pointed to last by the atexit function will be executed first, followed by the second to last one, and so on.
The atexit function accepts a single mandatory parameter: the pointer to the function to be called on program termination. ...
Read now
Unlock full access