DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   password input (http://www.daniweb.com/forums/thread73467.html)

Mac.Z Mar 26th, 2007 5:28 pm
password input
 
Hello,

How to read an input(string) from the user keyboard without displaying it on the I/S, but to disply a character that I specify like (*) instead of the actual inputted character.. and if possible to store the entry on array


right now, I can't find any replacement for getch() which is a nonstandard function and doesn't exactly do what I want..
getline() as far as I know can't hide the input..


Thanks

iamthwee Mar 26th, 2007 5:31 pm
Re: password input
 
Well done, you've realised there is no standard way to do that.

Your only option is to use a non-standard method, which is of course compiler and or OS dependent. Do you wanna see it?

http://faq.cprogramming.com/cgi-bin/...&id=1043284392

Mac.Z Mar 26th, 2007 5:40 pm
Re: password input
 
Thanks for your response,
what's driving me crazy is getch() is being taught at college..it's non-standard and they didn't mention anything about that !

iamthwee Mar 26th, 2007 5:45 pm
Re: password input
 
Yeah well there ya go. It probably doesn't matter until you hit the real world. Schools just try to teach the fundamentals, logic etc, and pseudo code.

There are too many pitfalls persistent in c/c++ to catch out the unwary. You only get to know about them with experience.


All times are GMT -4. The time now is 3:39 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC