"E. Robert Tisdale" <E.**************@jpl.nasa.gov> wrote:
torno wrote:
Can someone guide me as to how I can modify the code below to hide
characters from displaying on the screen as they are entered?
If there is a better way of achieving this, please let me know.
Read the FAQ. The FAQ is your friend.
<http://www.eskimo.com/~scs/C-faq/q19.1.html>. Admittedly, the way this
question is phrased in the index for section 19 is incomplete; but a
search of the text version (posted here regularly) on "password"
would've turned up this question.
> cat main.c #include <unistd.h>
This is not ISO C, and therefore off-topic.
char *getpass(const char* prompt);
This is not ISO C, and therefore off-topic. Moreover, function
declarations within other functions (yes, even within main()) are a Bad
Thing.
getpass("Enter password: "));
This is not ISO C, and therefore off-topic.
> gcc -Wall -std=c99 -pedantic -o main main.c
We don't care what your broken compiler says, it's still off-topic.
I'd tell you to read the bloody FAQ, as well, but in your case it would
probably be a waste of time, since you don't appear to give a damn.
Richard