Solved

no echo for a password field

Posted on 1996-12-09
1
1,031 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do the JavaScript &&  !== operators work together? 3 55
WCAG audit tools 1 81
c++ syntax question 9 47
Why isn't object file created? 6 57
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

813 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

15 Experts available now in Live!

Get 1:1 Help Now