fork download
  1. class MyObject{};
  2.  
  3. void myFunction(){
  4. MyObject obj1();
  5. MyObject *objPtr = &obj1;
  6. }
  7.  
  8. int main() {
  9.  
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void myFunction()’:
prog.cpp:5:22: error: cannot convert ‘MyObject (*)()’ to ‘MyObject*’ in initialization
  MyObject *objPtr = &obj1;
                      ^
prog.cpp:5:12: warning: unused variable ‘objPtr’ [-Wunused-variable]
  MyObject *objPtr = &obj1;
            ^
stdout
Standard output is empty