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 92 views
1 answer 159 views
1 answer 197 views
1 answer 242 views
1 answer 187 views
187 views asked Jan 14, 2017 by avibootz
...