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