| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Guys,
![]() I am trying to create a login screen, that will prompt the user for a name and password - but the problem is I don't want the password on the screen, instead I want some asterisk sign. I don't want to use the conio.h file. Is there any way to do it (the ANSI way) ? |
|
#2
|
||||
|
||||
|
to my knowledge, there is not.... I had the same question a while back and I could not find a way around the conio.h solution.... why exactily do you want to avoid it?
altho, the Borland compiler does have a kb_hit() function, but I don't know if that would work for you.... cheers ![]() |
|
#3
|
|||
|
|||
|
Hi,
I didn't want to use conio.h because that's not ANSI (as far as I know). Anyways, now conio.h will do - here's a program I found out a while ago - #include <iostream> #include <string> #include <conio.h> using namespace std; void main() { string password; cout <<"\nPassword\t:\t" << endl; char c = 't' ; while (c != '\n') { c = getch(); password += c; putch('*'); } cout << "\nYou entered\t:\t" << password << endl; getch(); } The code seemed alright - but unfortunately doesn't work. Can't figure this out. Any help would be great - thnx. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|