fork(3) download
  1. #include <iostream>
  2.  
  3. struct MyClass
  4. {
  5. MyClass()
  6. {
  7. std::cout << "ctor" << std::endl;
  8. }
  9. ~MyClass()
  10. {
  11. std::cout << "dtor" << std::endl;
  12. }
  13. };
  14.  
  15. int main()
  16. {
  17. MyClass m1, m2;
  18. std::cout << "Hello" << std::endl;
  19. }
  20.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
ctor
ctor
Hello
dtor
dtor