**我想要一种在键入控制台**时隐藏密码的方法
bool User::isLogIn(){
string username, password, file_line;
cout << "Enter username:";
cin >> username;
cout << "Enter password:";
cin >> password;
ifstream infile;
infile.open("users.txt");
if (!infile.is_open()){
cout << "Error while opening the file...";
}
else{
string str;
while (getline(infile, str)){
vector<string> newVector = split(str);
string username_from_file = newVector[1];
string password_from_file = newVector[3];
if ((username_from_file.compare(username) == 0) && (password_from_file.compare(password)) == 0){
return true;
}
}
}
return false;
}
任何人都可以告诉我如何制作它,以便当您输入密码时显示为&#34; *&#34;&#39; s?