-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.h
More file actions
61 lines (33 loc) · 869 Bytes
/
account.h
File metadata and controls
61 lines (33 loc) · 869 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef ACCOUNT_H_
#define ACCOUNT_H_
#define MAX_NAME_LEN 30
#define MAX_COUNTRY_LEN 30
#define MAX_USERNAME_LEN 10
#define MAX_PASSWORD_LEN 8
struct Person
{
char fullname[MAX_NAME_LEN + 1];
int birth_year;
double household_income;
char country[MAX_COUNTRY_LEN + 1];
};
struct UserLogin
{
char username[MAX_USERNAME_LEN + 1];
char password[MAX_PASSWORD_LEN + 1];
};
struct Account
{
int id;
char type;
struct Person person;
struct UserLogin login;
};
void getPerson(struct Person * person);
void getAccount(struct Account * account);
void getUserLogin(struct UserLogin * login);
void updateAccount(struct Account * account);
void updatePerson(struct Person * person);
void updateUserLogin(struct UserLogin * login);
int authenticate(const struct Account accounts[], int max_accounts);
#endif