fork download
  1. struct A
  2. {
  3. void func_a() { this = nullptr ;}
  4. };
  5.  
  6. int main()
  7. {
  8. A b ;
  9. b.func_a() ;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘void A::func_a()’:
prog.cpp:3:23: error: lvalue required as left operand of assignment
  void func_a() { this = nullptr ;}
                       ^
stdout
Standard output is empty