jeudi 23 novembre 2017

How to mask a 4 digit integer "PIN" number with asterisk

For context, I'm using a Mac, can't use the conio.h library (therefore the getch() method will be unavailable) and I'm programming in C++. How can I have the user enter in their PIN number and have each character entered, produce a '*' afterwards in the console. Similar to logging into any account online where the password is masked.

If you could let me know of any variations to the getch() method, I'd greatly appreciate it too.

Many thanks.

Aucun commentaire:

Enregistrer un commentaire