C++ help

Humanoid

Member
May 6, 2001
104
0
0
Hi... a c++ newbie here...
currently i'm having a problem with this little part...
can anyone provide me with the codes to solve my problem...

well...here's the problem... I intend to write a program (console application) that requires the user to enter a password... but i don't have any idea on how to make the password to be "masked" instead of displaying what the user have typed (eg: when the user type "1234", i want it to be displayed as "****"). can anyone help me please...???? or is it impossible to do that?
thanx in advance

 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Grab each character as it comes in and then position your cursor to output a masking character.
 

Humanoid

Member
May 6, 2001
104
0
0


<< Grab each character as it comes in and then position your cursor to output a masking character. >>



i'm not really sure... can anyone provide some codes?
thanx
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
the easy way would be to use getch or get or getchar... one of them does not echo to the screen. so they won't see anything. if you want them to see stars, either hit them on the head ;), or print out an asterisk every time you read a key press using one of those functions. :)