954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Mac.Z
Newbie Poster
11 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

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/smartfaq.cgi?answer=1045691686&id=1043284392

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

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 !

Mac.Z
Newbie Poster
11 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

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.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You