问题
Possible Duplicate:
Read a password from std::cin
Replace input with “ * ” C++
I'm looking for the C/C++ comparable way of doing <input type="password" />
for allowing the user to type in their password after a prompt in a command-line tool written in C.
string username;
string password;
cout << "Username: ";
getline(cin, username);
cout << "Password: ";
[<input type="password" />]
getline(cin, password);
来源:https://stackoverflow.com/questions/13691249/how-does-one-display-when-typing-a-password-in-a-c-c-command-line-tool