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
274 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now