•
•
•
•
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
![]() |
•
•
Join Date: Jul 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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:
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:
•
•
Join Date: Nov 2004
Location: Tucson, Az
Posts: 107
Reputation:
Rep Power: 4
Solved Threads: 2
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.
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
Similar Threads
- java text field for password please (Java)
- Password (Windows NT / 2000 / XP / 2003)
- hide user from login screen (OS X)
- website password protection (JavaScript / DHTML / AJAX)
- Access Sub switchboard password protection (Visual Basic 4 / 5 / 6)
- ?Password+Protection of External HDD? (Windows NT / 2000 / XP / 2003)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the C Forum
- Previous Thread: What is Telecommunication Domain!
- Next Thread: Error In DevCPP



Linear Mode