|
-
Jan 21st, 2006, 10:44 AM
#1
Thread Starter
Frenzied Member
Using putback for passwords
I'm trying to hide the password as the user enters it, but for some reason it's not working. it seems like an infinite loop:
Code:
string get_password()
{
string give_back;
char temp;
while(cin.get(temp) != 0)
{
//give_back += temp;
cin.putback('*');
}
return give_back;
}
-
Jan 21st, 2006, 11:35 AM
#2
Re: Using putback for passwords
putback() doesn't do what you think. Look it up.
There is no way in standard C++ to achieve what you want. It's only possible using platform-specific API.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|