fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <iostream>
  9. #include <bits/stdc++.h>
  10.  
  11. class Base
  12. {
  13. public:
  14. Base() {};
  15. virtual ~Base() { std::cout << "Destructor Base\n"; };
  16. };
  17.  
  18.  
  19. class Derived : public Base
  20. {
  21. public:
  22. Derived() {};
  23. };
  24.  
  25. int main()
  26. {
  27. Derived *b = new Derived();
  28. delete b;
  29. return 0;
  30. }
  31.  
  32.  
  33.  
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
Destructor Base