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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create mosaic from photograph 9 158
C# - Function parentheses 11 56
.Net Errors Service Crashing 5 130
a reliable reference for c+11? 3 74
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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