fork download
  1. #include <iostream>
  2.  
  3. class ITest {
  4. public:
  5. ITest(){}
  6. virtual ~ITest(){}
  7. virtual void foo() = 0;
  8. };
  9.  
  10. class Test : public ITest {
  11. public:
  12. virtual void foo() {
  13. if (!this) {
  14. std::cout<<"Blah!"<<std::endl;
  15. return;
  16. }
  17. std::cout<<"Foo!"<<std::endl;
  18. }
  19. };
  20.  
  21. int main() {
  22. Test* t = NULL;
  23. t->foo();
  24. return 0;
  25. }
Runtime error #stdin #stdout 0s 2848KB
stdin
Standard input is empty
stdout
Standard output is empty