fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct test_t
  5. {
  6. int a;
  7. ~test_t()
  8. {
  9. cout << "bye bye" << endl;
  10. }
  11. };
  12. test_t* get()
  13. {
  14. test_t t;
  15. return &t;
  16. }
  17.  
  18. int main()
  19. {
  20. cout << "call get()" << endl;
  21. test_t *t = get();
  22. cout << "comeback to main" << endl;
  23. return 0;
  24. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
call get()
bye bye
comeback to main