0

While entering the password and id in the program ,i want the program should not display any of those entered characters.
While enter the password it should show the astericks for eg.
******
By using Scanf,it is not possible..

By using getpass() function it just doesn't display any thing on the screen.
So please give me a clue for it !!!!

4
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by ajay.krish123
0

I'm not quite sure...
If u're using bc5 this might works. but if u're using microsoft visual studio, as long as I know, this won't work

use getch() for character inputting one by one. this function is included in conio.h. then manipulate it using \b and *.

but still, I'm not sure this will work if u're pressing backspace when the program runs.

0

i think u might use the getch() putch combination
use getch to enter the charcter one by one and then using putch print out *

example:

getch(password[x]);  //where x runs in a loop from 0 till NULL
putch('*');

PS:go through this thread

[url]http://www.daniweb.com/forums/thread9916.html[/url]

has a better detailed solution....

This will work -- but only if you are using a compiler that defines getch() properly. Most don't.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.