Beginner C++ student here, first ever programming class. I am studying the code below for a number guessing game using a for loop and void function. However, I know the for loop where I noted the comment below has an issue, but for the life of me I cannot wrap my head around it and why it's not working. I understand basic for loops, but the structure it's been put into in this scenario is throwing me off a bit. From the demonstration by the professor I wrote down that line of code wrong (way off) and I get the results in the screenshot in the link below.
The program is suppose to loop asking "Guess again" until the number is guessed along with the hints provide. Unfortunately, the professor will not be available for quite a bit and I would like to get that line corrected. Hence, why I am asking for the help of you wonderful c++ experts. Thank you so very much for your time and guidance!!
I believe I can see your problem. The problem is with line 35 as you suspected, because your for loop has no opening and closing curly brackets { and } it means that the for loop only applies to the single line that comes after it. To fix this you would simply need to wrap the code you need to loop around curly brackets like you would do for a function or an if statement.