cpp-cheat/c/atexit.c
2015-06-07 11:17:09 +02:00

19 lines
312 B
C

/*
# atexit
Function gets called when process ends via `exit` or a `return` on the `main` function.
Does not get called on abnormal termination, e.g. from signals.
*/
#include "common.h"
void atexit_func() {
printf("atexit\n");
}
int main() {
atexit(atexit_func);
return EXIT_SUCCESS;
}