fork(1) download
  1. #include <iostream>
  2.  
  3. struct abc {
  4. int a;
  5. abc() : a(42) {
  6. std::cout << "constructing abc @ " << this << '\n';
  7. }
  8. ~abc() {
  9. std::cout << "destroying abc @ " << this << '\n';
  10. }
  11. };
  12.  
  13. int main() {
  14. {
  15. abc ob1;
  16. }
  17. {
  18. abc *ob2 = new abc;
  19. }
  20. }
Success #stdin #stdout 0s 4176KB
stdin
Standard input is empty
stdout
constructing abc @ 0x7fffee7e7090
destroying abc @ 0x7fffee7e7090
constructing abc @ 0x5636c3c2bc30