Posted by justin adams on 2001-01-19
im not sure what all those ||'s were. i guess i havent been coding long
enough, heh (im just on my second college C++ course, anyway). but, i was
reading your post and remembered enum. our teacher never said much about
enum, but i thot it was a really handy tool.
for instance:
enum FIGHTING_STYLE = { GungFu, Karate, Capouera, Boxing };
enum basically assigns each entry an index number (kind of like #define.
not sure, tho. i havent used define much, either). in the above example
any time you referred to "GungFu", a 0 would be returned in its place. and
a 1 for "Karate", 2 for "Capouera", and 3 for "Boxing".
set_fighting_style(player1, Capouera);
but my whole thing is id rather find simpler ways than classes. but thats
prolly just me. and if theres more info that needs to be side by side with
the style, a class might work too.
just a thot, ya know
-munki
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Previous post | Next post | Timeline | Home