fork(1) download
  1. #include <iostream>
  2.  
  3. class Base
  4. {
  5. public:
  6. virtual ~Base()=0; // Pure virtual destructor
  7. };
  8.  
  9. class Derived : public Base
  10. {
  11. public:
  12. ~Derived()
  13. {
  14. std::cout << "~Derived() is executed";
  15. }
  16. };
  17.  
  18. int main()
  19. {
  20. Derived d;
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:20:18: error: expected primary-expression before ‘<<’ token
     Derived d;   <<<
                  ^~
prog.cpp:20:20: error: expected primary-expression before ‘<’ token
     Derived d;   <<<
                    ^
prog.cpp:21:5: error: expected primary-expression before ‘return’
     return 0;
     ^~~~~~
stdout
Standard output is empty