?
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
Medium Priority
?
286 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 150 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

719 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