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