I'm a noob when it comes to C programming. I wrote a simple program that runs an infinite for loop. But inside that loop I wanted to create another loop to stop the user three times after entering incorrect passwords.
I tested from different angles it seems like the infinite loop ignore my other loop.
What should I do to stop the user from entering endless bad password?
// if true the program runs and stop loop, no problem
display an error message;
ask user to type password again;
/* I put a break keyword, but it doesn't stop the endless loop if a person type in a bad password. */