, "", "". , , . getline . , . - :
ifstream inauth("Secret password herein.txt");
if (inauth) {
string usr, psw;
if (getline(inauth, usr) && getline(inauth, psw) {
if (usr == user && psw == password) {
cout << "Phew, everything fine.";
} else {
cout << "Wrong password/username.";
}
} else {
cout << "I guess somebody opened the file in notepad and messed it up."
}
} else {
cout << "Can't open file, sorry.";
}