Hello everyone I am really new to C++ and it would be great if you can give me some advice on how to check a username and a password from a txt file. I just started this work and I am stuck at this stage. please i need some advice thanks!
here is the code that stores the information into a txt file.so now i need to check next time that the username and the password are correct.
int main ()
{
cout<<"WELCOME"<<endl;
string mystr;
cout<<"Enter your name"<< endl;
getline(cin,mystr);
string data;
cout<<"Enter your pass"<<endl;
getline(cin,data);
ofstream myfile;
myfile.open ("pass.txt",ios::app);
myfile << data << " is the password " << "and the username is " <<mystr;
myfile.close();
}
well i went a bit through it but still i am figuring it out. I need a method that will take the mystr && data strings and it should look into the pass.txt file in order to check if the input is stored there. any suggestions ? :(