-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccount.cpp
More file actions
39 lines (32 loc) · 815 Bytes
/
Account.cpp
File metadata and controls
39 lines (32 loc) · 815 Bytes
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
#include "account.h"
#include"stdafx.h"
account::account(string s)
{
// throw gcnew system::notimplementedexception();
int index = s.find("|");//tra ve vi tri dau tien khi thay /
this->user = s.substr(0, index);
this->password = s.substr(index + 1);
}
string account::getuser()
{
return this->user;
}
string account::getpassword()
{
return this->password;
}
void account::setaccount(string users, string pass)
{
//throw gcnew system::notimplementedexception();
this->user = users;
this->password = pass;
}
istream &operator >> (istream &is, account &t) {
cout << "Enter user:"; is >> t.user;
cout << "Enter password:"; is >> t.password;
return is;
}
ostream &operator << (ostream &os, account &t) {
os << t.user << "|" << t.password << endl;
return os;
}