Hello all, I apologise if my question seems stupid but I have just recently started coding in c++ and this has been driving me crazy for hours. I have searched the web and experimented with different coding but cant seem to get it to work.
the nested if loop inside the while loop to check if the name is correct is just completely skipped whenever the program is run. it compiles fine and all that and I am just really confused as to why my program stops reading anything after this line of code int x = intInput(); and just goes back to the start of the while loop as the correctName bool is still set to false regardless of whether the user inputs 1 to indicate its correct.
Here's what the output that I get when I run your program:
Hello, user! Please enter your name...
dave
You entered: dave.
Is this correct?
1 - Yes.
2 - No.
1
Perfect, lets continue!
At that point nothing happens. The reason is that the code is in the infinite loop from lines 68-71. So I think the program is running correctly, you just have to add whatever is supposed to happen inside that loop.