+ 1
Does this password code i created work?
I'm on mobile at the moment and am unable to test properly. could someone help me out? https://code.sololearn.com/c154c98Rk3aN/?ref=app https://code.sololearn.com/c154c98Rk3aN/?ref=app
2 Answers
+ 3
You have one problem in the code. Inside the if statement you have
cout == "Yourpass"
where you really meant
input == "Yourpass"
Another key point is that the user can only enter 2 times the password(maybe that was what you needed). To have infinitely many takes on the password, you have to insert it in an infinite loop, and break it when the password is correct.
Here is the code
https://code.sololearn.com/c0Ts2oNLwc0r/?ref=app
+ 1
In line 10: Change cout to input