944,103 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2501
  • C++ RSS
Mar 26th, 2007
0

password input

Expand Post »
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
Last edited by Mac.Z; Mar 26th, 2007 at 5:38 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mac.Z is offline Offline
11 posts
since Feb 2007
Mar 26th, 2007
0

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
Last edited by iamthwee; Mar 26th, 2007 at 5:37 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Mar 26th, 2007
0

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 !
Last edited by Mac.Z; Mar 26th, 2007 at 5:40 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mac.Z is offline Offline
11 posts
since Feb 2007
Mar 26th, 2007
0

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.
Last edited by iamthwee; Mar 26th, 2007 at 5:46 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Polly's suitors in ONE HOUR!
Next Thread in C++ Forum Timeline: Arrays and for loops





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC