**I want a way to hide the password when I type in console **
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;
}
Can anyone tell me how to make it so that when you enter in the password it shows as "*"'s?