Solved

no echo for a password field

Posted on 1996-12-09
1
1,035 Views
Last Modified: 2013-11-18
  I'm on a unix system running "SunOS Release 4.1.2 (GENERIC)" on a Sun SPARC station 670MP.  I'm using the GNU project C and C++ Compiler (v2.4).
   I need to get keyboard input and store it without echoing the typed characters to the screen like in a password prompt...
   I've recieved many suggestions (on IRC) telling me to use the getchar(), getch(), getc() functions.  When I use these, however, I can still see typed characters...
   I've also tried changing the text color with textcolor() to that of the background, but the compiler I'm using doesn't have the conio.h header file.  
   If you have any suggestions let me know, please tell me the header files and libraries required to do this.
0
Comment
Question by:GBurk
[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 1

Accepted Solution

by:
evilgreg earned 100 total points
ID: 1162332
Have you tried curses?

#include <curses.h>

initscr();
noecho();
/** Grab password **/
echo();


Of course, there is a lot more to curses than this, but it's worth the effort to learn.

Make sure to compile with "-lcurses".

Try man curses or man 3 echo for more...


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

733 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