My code is coming along and working fine. But not sure if I am doing one section wrong. When I input a wrong answer, the level does not change and would stay like that indefinitely as long as I input wrong answers. But putting in right answers, the levels increase. Am I doing something wrong?
int main()
{
int LevelDifficulty = 1;
const int MaxDifficulty = 5;
while (LevelDifficulty <= MaxDifficulty) // Loop until all levels are completed
{
bool bLevelComplete = PlayGame(LevelDifficulty);
std::cin.clear(); // Clears any errors
std::cin.ignore(); // Discards the buffer
// Did the player complete the level
if (bLevelComplete)
{
++LevelDifficulty;
}
}