Solved

How to mask the input field so that it can't be displayed while user ipnuts it(like password)

Posted on 2007-04-10
1
279 Views
Last Modified: 2010-04-24
I am working with VC++.NET version.
I am reading a string (user has to input) from standard input using fgets. I don't want to display the string while the user enters it (like password field). How i can mask it?
0
Comment
Question by:rama_krishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
alexcohn earned 50 total points
ID: 18880803
You must use _getch() instead of fgets() and display the astericks yourself. Note that you will process backspace character yourself, too.

There is sample code here:
http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1045691686&id=1043284392
http://www.gamedev.net/community/forums/topic.asp?topic_id=287510
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question