+ 1
Modifying and Getting enums from other classes?!
I am making a program in c++ were I have made a private enum in a separate class file and I need to modify the value of it from another class which is friend to the other. I tried to make an object and do like: Obj.value = STOP or Obj.value = START but it does not work. What can I do? https://code.sololearn.com/co1HMgfp3tbl/?ref=app
2 odpowiedzi
+ 4
To access the enum values, you need to scope the values inside the member functions of class Input.
Eg :
void Logic::Input()
{
input.MState = Moving::START;
}
It seems enums are treated like static objects inside a class.
+ 1
Thank you again