Been trying to get a password working but it dont seem to work.
when u enter the wrong password it will ask you to re-enter it but you can put any number in and it will still work.
how can i stop this and make it carry on looping untill the write password is entered?
Code:int password() { int password; password==1205; cout << "Plese enter your 4 digit password that was provided on purchase"; cin >> password; int error=3; if (password !=1205) { cout<< "Plese re-enter the password"; error --; cin >> password; } if (password ==1205) { return 0; system ("CLS"); } if (error ==0) { cout << "WASHING MACHINE HAS BEEN DISABLED PLEASE CONTACT YOUR SUPPLIER"; system("pause"); } }