Python to c++ conversion problem
Ahmed MOHAMED ALI
ahmedmo at wanadoo.fr
Wed Mar 23 11:54:24 CET 2005
Convert the string to int then cast the int to enum with static_cast.
"Akdes Serin" <e0427463 at student.tuwien.ac.at> wrote in message
news:424141bb$0$12642$3b214f66 at tunews.univie.ac.at...
> I have a code in python like
> if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom
> function takes Direction enum as a parameter
> When I am trying to write this code in c++
> if (player->moveRoom(s)) //s is a string so it outputs an error
> because of not taking enum as a parameter
> How can I change string to enum in c++?
More information about the Python-list