[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

no echo for a password field

Posted on 1996-12-09
1
Medium Priority
?
1,050 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

656 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