fork(1) download
  1. #include <iostream>
  2.  
  3. class C
  4. {
  5. public:
  6. C(char s) : m_s(s) {}
  7. ~C() { std::cout << "destroying C[" << m_s << "]\n"; }
  8. char m_s;
  9. };
  10.  
  11. int main() {
  12. while (1) {
  13. C c1('a');
  14. while (1) {
  15. C c2('b');
  16. goto outer;
  17. }
  18. }
  19. outer:
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5476KB
stdin
Standard input is empty
stdout
destroying C[b]
destroying C[a]