hi everyone
i have book "C++ Programming for Games Module I" from Game Institute and the code put
here for download is based on the codes in the book. but when i try to debug it, it
make these errors:
//////////////////////////////
1>h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(21) : error
C2360: initialization of 'knight' is skipped by 'case' label
1> h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(17) :
see declaration of 'knight'
1>h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(27) : error
C2361: initialization of 'thief' is skipped by 'default' label
1> h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(22) :
see declaration of 'thief'
1>h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(27) : error
C2361: initialization of 'knight' is skipped by 'default' label
1> h:\game designing projects\roleplayinggame\roleplayinggame\player.cpp(17) :
see declaration of 'knight'
1>weapon.cpp
1>h:\game designing projects\roleplayinggame\roleplayinggame\weapon.cpp(24) : error
C2360: initialization of 'sword' is skipped by 'case' label
1> h:\game designing projects\roleplayinggame\roleplayinggame\weapon.cpp(18) :
see declaration of 'sword'
////////////////////////////////
which i can't fix. i tried "if" instead of "switch" and it seemed to work out but "if"
makes garbage values. it also happens when i put "case"s of "switch" in {}s.
can anybody help me what's wrong?
i'm stuck just in the begginnig of my code and i can't go any furthur
thanks everybody