User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 397,771 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,511 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 3101 | Replies: 2
Reply
Join Date: Jul 2005
Posts: 1
Reputation: fm_chicago is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
fm_chicago fm_chicago is offline Offline
Newbie Poster

Help hide a password

  #1  
Jul 10th, 2005
Think of typing a password. You type your password but what you see is merely a asterisk sign. If you use getch(), no problem! Put the problem is that I can't use the getch. See the code:

struct Func {
char password[9];
char name[34];
char code[8];
}element;

do{
gotoxy(21,6);
printf("****************************************");
gotoxy(21,7);
printf("**Password: *******");
gotoxy(21,8);
printf("****************************************");
gotoxy(46,7);
cin>>element.password;
}while(strlen(element.password)<4||strlen(element.password)>8);
fich.write((char *)&element,sizeof(Func));
fich.close();

Can some please tell how can i hide the password, in this case? :cry:
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Tucson, Az
Posts: 107
Reputation: prog-bman is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
prog-bman prog-bman is offline Offline
Junior Poster

Re: hide a password

  #2  
Jul 10th, 2005
There is no way with cin>> because the input is buffered.
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++

Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Reply With Quote  
Join Date: Sep 2004
Posts: 6,050
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 26
Solved Threads: 416
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: hide a password

  #3  
Jul 10th, 2005
>the problem is that I can't use the getch.
Then you have to write a routine with equivalent functionality. There's no standard way to do what you want.
Member of: Beautiful Code Club.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 4:26 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC