How to censor password?

Pages: 12
Dec 3, 2013 at 12:59am
Suggestion: do your own work, making sure that your program functions correctly (according to the assignment, no more and no less), and avoid all the pretty stuff. I would also have a comment in there with the echo function to explain why that is all you need.

Dec 4, 2013 at 11:17am
im suppose to include that extra stuff for more marks XD also to make it look as close to an actual site as possible
Dec 4, 2013 at 11:52am
Ah. Well, the SetConsoleMode() function will also allow you to set the input mode to unbuffered input, so that every time the user presses a key it is immediately available as input.

A useful function is also here:
http://www.cplusplus.com/forum/articles/7311/2/#msg106286

The method is to get the user's input, and saving it to string, writing '*'s to the screen. You'll need to handle '\b' (backspace) specially. The enter key is '\r'.

Good luck!
Dec 9, 2013 at 9:52am
I've finally managed to mask the passcode. well there's that problem with the backspace, but as long as they dont type it in wrongly it should work XD
Dec 9, 2013 at 8:42pm
If they press the backspace just remove the last character from your string and print "\b \b".

Glad you got it working!
Topic archived. No new replies allowed.
Pages: 12