2

可能重复:
从 std::cin 读取密码
将输入替换为“*” C++

我正在寻找 C/C++ 类似的方式<input type="password" />来允许用户在用 C 编写的命令行工具中出现提示后输入他们的密码。

string username;
string password;
cout << "Username: ";
getline(cin, username);
cout << "Password: ";
    [<input type="password" />]
getline(cin, password);
4

0 回答 0