atexit
#include <stdlib.h>
#include <stdio.h>
void bye()
{
printf("byte\n");
}
void goodbyte()
{
printf("good byte\n");
}
int main(int argc, char *argv[])
{
atexit(bye); //bye will be called after exit
atexit(goodbyte); //goodbyte will be called after exit
printf("hello\n");
return 0;
}
浙公网安备 33010602011771号