How to use at_quick_exit to register functions called on quick_exit in C

1 Answer

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

void f1(void) {
    puts("f1");
}

void f2(void) {
    puts("f2");
}

int main(void)
{
    at_quick_exit(f1);
    at_quick_exit(f2);

    quick_exit(0);
}



/*
run:

f2
f1

*/

 



answered Jan 26, 2023 by avibootz

Related questions

1 answer 182 views
1 answer 90 views
90 views asked Jan 26, 2023 by avibootz
1 answer 74 views
74 views asked Jan 26, 2023 by avibootz
3 answers 263 views
1 answer 112 views
1 answer 263 views
...