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