How to use _Exit to terminate a program without cleaning the resources in C

1 Answer

0 votes
#include <stdlib.h>
#include <stdio.h>
 
void f(void) {
    puts("void f(void)");
}
 
int main(void)
{
    printf("main()\n");
    
    atexit(f);
    
    fflush(stdout);   // may not run
    
    _Exit(0);
}



/*
run:

main()

*/

 



answered Dec 20, 2022 by avibootz

Related questions

1 answer 79 views
1 answer 143 views
1 answer 187 views
1 answer 234 views
1 answer 174 views
174 views asked Jan 14, 2017 by avibootz
...