Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMD LINE PASSWORD INPUT USING C++

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
US
Hi! i think i have asked this question before, i did get some replies, but i couldnt get any to complie, and now i need to do this really badly, i want to be able to take password input from cmd line so that the chars being entered on the keyboard do not get echoed back to the screen. just like how u logon using telent/mySQL etc.

thanx a lot

Ankur.

ps:- this for c++ on solaris
 
finally i have got the answer from some website, which actually works without any proble, if there is a better way ,i would still like to know, but if someone wants to use this,it works..

take care.

system ("stty -echo"); /* turn echo off */
scanf ("%s", enteredPassword);
system ("stty echo");

-Ankur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top