fork(2) download
  1. #include <iostream>
  2.  
  3. struct A
  4. {
  5. A() {std::cout << "A";}
  6. ~A() {std::cout << "D";}
  7. };
  8.  
  9. int main()
  10. {
  11. int counter = 0;
  12.  
  13. label:
  14. if (counter++) // Exit on second run
  15. return 0;
  16.  
  17. A a;
  18. goto label;
  19. }
  20.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
AD