fork download
  1. #include <iostream>
  2.  
  3. class A {
  4. public:
  5. void f();
  6. };
  7.  
  8. void A::f()
  9. {
  10. if (!this) {
  11. std::cout << "null pointer\n";
  12. } else {
  13. std::cout << "wtf?!\n";
  14. }
  15. }
  16.  
  17. int main()
  18. {
  19. A *a;
  20. a->f();
  21. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
null pointer