Your probleme lies in
if (myDifficulty = 3)
You are only asigning the value 3 (or 1 or 2) to the myDiffculty, change the '=' too '==' and it shuld work.
You arent using the enum difficulty.... if you
change the testing to:
if (myDifficulty == Easy)
you are using the enum.
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5
no match for 'operator>>' in 'std::cin >> myDifficulty' is the error I get, and it means that you havent declared anny overload for the >>. but use int for geting the choise, and use the enum for testing. cant think that the book want you to start overloading in chapter2 :)
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5
it show the menu 1,2 and 3 becuse in
if (myDifficulty = 3)
you aint checking, you are asigning the value 3 to myDifficulty change it to
if (myDifficulty == 3)
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5