-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathloadUsers.cpp
More file actions
52 lines (51 loc) · 1.02 KB
/
loadUsers.cpp
File metadata and controls
52 lines (51 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int counter1=0;
bool loadUsers(string userslist[],string passwordslist[])
{
string line;
ifstream user;
user.open("Users.txt");
if(user.is_open())
{
for(int i=0;!user.eof();i++)
{
getline(user,line,',');
userslist[i]=line;
cout<<userslist[i]<<endl;
getline(user,line);
passwordslist[i]=line;
cout<<passwordslist[i]<<endl;
cout<<endl;
counter1++;
}
}
else
{
cout<<"Sorry, we are unable to run the program, as user data does not exist."<<endl<<endl;
}
}
int main()
{
string username;
string password;
string userslist[100];
string passwordslist[100];
loadUsers(userslist,passwordslist);
cout<<"Username : ";
cin>>username;
cout<<endl<<"Password : ";
cin>>password;
cout<<endl;
if((username==userslist[0]&&password==passwordslist[0])||(username==userslist[1]&&password==passwordslist[1]))
{
cout<<"OK DI WAZSH LAO ";
}
else
{
cout<<"wargaye vai";
}
return 0;
}