fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct tp
  5. {
  6. tp()
  7. {
  8. cout<<"constructor\n";
  9. }
  10. ~tp()
  11. {
  12. cout<<"destructor\n";
  13. }
  14. };
  15.  
  16. int main()
  17. {
  18. tp* ptr=new tp();
  19. }
Success #stdin #stdout 0s 4152KB
stdin
Standard input is empty
stdout
constructor