Pretty sad event

So like I was coding. You know minding my own business then all of the sudden I accidently put in the wrong if statement.
The whole time I tried figuring out what was wrong because since the code was technically correct it didn’t throw up any flags for me to figure out what was the problem, and the video is a pain because he would scroll to points I was for sure wasn’t the problem. Thank Coding god that alismail posted a picture of his code. Your my hero.

It’s frustrating when that happens. If you’re really stuck you can refer to the code in GitHub for the end of the lecture. The link is in resources.

i also encountered this problem and this was my code int main()

{

int LevelDifficulty = 1;

while (true)

{

bool bLevelComplete = PlayGame();



std::cin.clear();

std::cin.ignore();

}

if (bLevelComplete)

{

    /* code */

}

after half an hour of looking i found out my if statement was outside of the while process

found your post and was even more puzzled due to your wording about putting a wrong if statements,as if there are different if statements.

but what i think you meant was that you put the if statement in a incorrect place i.e outside the while statements

What’s wrong only is to according here you :grinning:

Privacy & Terms