atexit()
function more than once. But, they will be executed in reverse order as a stack.#include <stdio.h>
#include <stdlib.h>
void Exit1 (void)
{
printf ("Exit1 function is called\n");
}
void Exit2 (void)
{
printf ("Exit2 function is called \n");
}
int main (void)
{
atexit (Exit1);
atexit (Exit2);
printf ("This is the end of this program.\n");
return 0;
}