struct thing { int member; void myfunction() const { int thing1 = 65; thing1 = 3; member = -1; //error: assignment of data-member ‘thing::member’ in read-only structure } };
Standard input is empty
prog.cpp: In member function ‘void thing::myfunction() const’: prog.cpp:7: error: assignment of data-member ‘thing::member’ in read-only structure
Standard output is empty