Assign function which is called when exit : Exit Abort « Development « C / ANSI-C






Assign function which is called when exit


#include <stdlib.h>
#include <stdio.h>

void done(void);

int main(void)
{
  if(atexit(done)) 
      printf("Error in atexit().");

  return 0;
}

void done(void)
{
  printf("Hello There");
}


           
       








Related examples in the same category

1.Abort current process returning error code: how to use abort
2. Specifies a function to be executed at exit: how to use atexit
3. Terminate calling process: how to use exit