Hi, I'm a C++ beginner making a password protection program, and it works almost perfectly. The only problem is, if a user types their password wrong, it says invalid (obviously), but if they try and re-enter the correct password, it continues to say invalid, I suspect my program doesn't clear the value of the char after an unsuccessful attempt, so all it does is keep comparing the same char to the correct password. How do I fix this? My code is below. Thanks
1) It should be initialised as pass="";
2)You are checking password in Auth() so why you go to main() for reentering password?Also reset pass=""; in Auth();
3)don't decrypt original password.encrypt entered password and check it with encrypted original password.
Hi, I did all those changes and it still doesn't work, the code is c = getch();, all I need to do is clear the input stream after using getch(), I'm sure of it. How do I do that?