Need help for how to check from txt file

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 now i need to check next time that the username and the password are correct.

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main ()
string mystr;
cout<<"Enter your name"<< endl;
string data;
cout<<"Enter your pass"<<endl;

ofstream myfile; ("pass.txt",ios::app);
myfile << data << " is the password " << "and the username is " <<mystr;
open the file, read the data and compare the users input with the strings from the file

thank you very much darkmaster i ll have a look and I will let you know. Appreciate your interest to help me.

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 ? :(
Topic archived. No new replies allowed.