Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 8 years ago

Language

Compiler

Options

Author

anonymous

almost 8 years ago

$
prog.cc:9:3: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   const int getId()
   ^~~~~
prog.cc: In member function 'int MyClass::setId(const int&)':
prog.cc:17:10: error: assignment of read-only reference 'id'
     id = 1;
          ^
prog.cc:18:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
prog.cc: In member function 'int MyClass::getId() const':
prog.cc:22:16: error: assignment of member 'MyClass::id' in read-only object
     this->id = 1;
                ^
Exit Code:
1