C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 7th, 2005, 10:13 AM
neo_darko neo_darko is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 4 neo_darko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 2 sec
Reputation Power: 0
Red face Help

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) ?

Reply With Quote
  #2  
Old April 8th, 2005, 06:20 PM
B-Con's Avatar
B-Con B-Con is offline
:bcon: moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Location: int main()
Posts: 351 B-Con User rank is Private First Class (20 - 50 Reputation Level)B-Con User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 23 h 1 m 43 sec
Reputation Power: 4
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

Reply With Quote
  #3  
Old April 13th, 2005, 08:36 AM
neo_darko neo_darko is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 4 neo_darko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 2 sec
Reputation Power: 0
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:
Originally Posted by B-Con
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway