Reading a keystroke w/o echo

Juha Nurmela junki at lut.fi
Fri May 24 04:43:02 AEST 1991


Randy Azarian writes:

>I need to accept a user password (that won't echo to the screen).  So what I 
>am looking for is an ANSI-C routine that will accept a keystroke without 
>echoing it to the screen.
>
>Does anyone know of such a function or a way to fool stdin/stdout to 
>accomplish the same thing?

Simple solution... Portable ?

puts("Please dim Your monitor with knob called brightness.");
puts("Then key Your passwd terminating with ENTER and readjust the knob");
gets(password);
puts("\n\n\n\n ...50 times ... \n");

juha nurmela

-- 
         juha nurmela, Adr. 54430 Hujakkala, Finland. Tel. 953 78022
                  eiku: skinnarilank. 28d10, Tel. 953 26292



More information about the Comp.lang.c mailing list