Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- john 123
- jim 89
- britney 852
- john 123
- jim 89
- britney 852
- britney 852
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- string passwd;
- string usern;
- string password;
- string username;
- ifstream infile;
- string line;
- infile.open("sample.txt");
- if(!infile)
- {
- cerr << "error during opening of the file" << endl;
- }
- else
- {
- while (!infile.eof())
- {
- infile >> usern >> passwd ;
- cout << usern << " " << passwd << endl;
- }
- }
- cout << "Enter user name : ";
- cin >> username;
- if (usern == username)
- {
- cout << "already exist" << endl;
- }
- infile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement