How to censor password?

Pages: 12
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.

im suppose to include that extra stuff for more marks XD also to make it look as close to an actual site as possible
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!
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
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