atexit registers a function for execution during normal program termination. The registered function is not called when passed: atexit(sayGoodBye) passes a reference to sayGoodBye. Such handlers can free memory, write a termination timestamp, or perform other cleanup. section 8.8
Registering a termination handler
void sayGoodBye(void) { if (errno) perror("terminating with error condition"); fputs("Good Bye\n", stderr); } int main(int argc, char* argv[argc+1]) { atexit(sayGoodBye); ... } After normal termination, sayGoodBye executes and reports the execution status. section 8.8
int atexit(void func(void)); int at_quick_exit(void func(void));
Use the declaration to see that atexit receives a function parameter returning void and returns an int. section 8.8

