converting from int to enum
I have a struct with an enum member and this handles my colors. What I want to do is ask the user to enter a color, preferably 0 for white, 1 for red..etc.. How would I convert this int to an enum? Any easier way to do this beside typecasting?
I guess AP is trying to say
eColor = static_cast<enumColor>(nUserColor);
-Neophyte
- Death awaits you all with nasty, big, pointy teeth. -
eColor = static_cast<enumColor>(nUserColor);
-Neophyte
- Death awaits you all with nasty, big, pointy teeth. -
Or even:
eColor = (enumColor)nUserColor;
for the brave and bold knights of old among us...
---------------
I finally got it all together...
...and then forgot where I put it.
eColor = (enumColor)nUserColor;
for the brave and bold knights of old among us...
---------------
I finally got it all together...
...and then forgot where I put it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement