You are essentially abusing goto to create a loop. Instead, use an explicit loop:
I only used goto in one small section, since I don't have much need for it elsewhere....Note that this automatically handles the case where the user types an invalid option by looping around, though it is generally nicer to print a specific message in this case.
Another potential improvement is to dynamically remove invalid options from the menu. Something like this:...I'm not sure if you are familiar with std::vector or function pointers. Feel free to ask a question if you don't understand what this code is doing.
From what I can see in the second example, it's working sort of like an array. It appears to be creating a single, erm, (for lack of a better term) method that carries the other functions in it, kinda like how a class works? Then it grabs how many functions are underneath CombatChoice and displays them, dependent upon wether or not they meet the conditions given when using the push_back function. (not sure what push_back is)
Finally, when choosing the option, the reason you created that variable when creating the menu was to add an extra bumper in case the player chose the number of an option that wasn't even there.
I'll do a bit of reading on std::vector, since this is the first time I've come across the term. This was actually my first serious C++ project, so I had to hunt down tons of stuff on the net.
Anyhow, thanks for the advice, and I'll be working on improving my code once my compiler gets fixed...








