+ 1
I need help to make this C++ password function more secure and better
const int password = 4321; void security(int pwd) { cout<<"Enter password: "; cin>>pwd; if(pwd!=password) { cout<<"WRONG PASSWORD\n"; exit(0); } }
2 ответов
+ 3
ask characters using getch() which doesnt display entered character on to screen. everytime u recieve one character, print a *, if user presses back key, print '\b', backspace character.
+ 2
you could make it in a loop and stop the program if someone tries to enter a wrong password more than 3 times