fork(1) download
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. void clean(){
  6. cout<<"cleanup!";
  7. for(int i = 0; i < 15;++i){
  8. cout<<"¤";
  9. }
  10. }
  11.  
  12. int main() {
  13. // your code goes here
  14. atexit(clean);
  15. clean();
  16. cout<<1<<'\n';
  17. exit(0);
  18. cout<<5<<'\n';
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
cleanup!¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤1
cleanup!¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤