Input Masks - PASSWORDS
I am trying to create a input mask for a password. You know how you always see the letters you are typing...how do I change these to astericks. I know there has to be a way, I just can't seem to find it. This is in the Win32 screen, otherwise I would know how to do it. Any help would be greatly appreciated. Thank you.
(Both getch() and getche() are non-standard: )
Any techniques you use will be non-standard and non-portable (specific to your compiler/platform).
#include <conio.h> // non-standard
getch(); // Get character. Don't "echo" to screen.
getche() // Get character. Echo to screen
As far as I know, the C++ language standard "expects" all input to be displayed on the screen.
It does not require that any input be recognized by your program before hitting ENTER.
And, although you can always backspace, the standard does not require the console to have the capability of over-writing a line after a carrage-return and/or linefeed. (There is no gotoxy() in the standard.)
Now, true Win32 applications don't use <iostream>, <stdio>, or <conio>. You capture the keyboard "messages" in your Windows Processing Loop, and you can do whatever you want with the keyboard input!