-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.h
More file actions
26 lines (23 loc) · 703 Bytes
/
User.h
File metadata and controls
26 lines (23 loc) · 703 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
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define USER_LEN sizeof(User)
/****定义用户****/
typedef struct User {
char UserName[16]; // 用户名
char Password[15]; // 密码
uint8_t UserGroup; //用户所在组
User() {};
User(const char* userName, const char* password, uint8_t userGroup) {
strcpy(UserName, userName);
strcpy(Password, password);
this->UserGroup = userGroup;
};
}User;
//用户相关操作函数声明
bool addUser(const char* userName, const char* password, uint8_t userGroup);
bool checkUser(User* user);
bool changeUserAccess(uint16_t index, uint8_t access);
int16_t findUserName(const char* userName);
bool formatUser();
void printUserInfo(uint16_t index);