parent
4ad69293bb
commit
f7dd21a946
@ -1,34 +1,34 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifndef CONTACT_MANAGER_H
|
#ifndef CONTACT_MANAGER_H
|
||||||
#define CONTACT_MANAGER_H
|
#define CONTACT_MANAGER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include<vector>
|
#include<vector>
|
||||||
|
|
||||||
// 声明联系人结构体
|
// 声明联系人结构体
|
||||||
struct Contact {
|
struct Contact {
|
||||||
int id;
|
int id;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string phone;
|
std::string phone;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 声明联系人管理类
|
// 声明联系人管理类
|
||||||
class ContactManager {
|
class ContactManager {
|
||||||
private:
|
private:
|
||||||
std::vector<Contact> contacts; // 存储联系人的向量
|
std::vector<Contact> contacts; // 存储联系人的向量
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// 添加联系人
|
// 添加联系人
|
||||||
void addContact();
|
void addContact();
|
||||||
|
|
||||||
// 显示通讯录
|
// 显示通讯录
|
||||||
void displayContacts() const;
|
void displayContacts() const;
|
||||||
|
|
||||||
// 查找联系人
|
// 查找联系人
|
||||||
void findContact() const;
|
void findContact() const;
|
||||||
|
|
||||||
// 删除联系人
|
// 删除联系人
|
||||||
void deleteContact();
|
void deleteContact();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONTACT_MANAGER_H
|
#endif // CONTACT_MANAGER_H
|
||||||
|
Loading…
Reference in new issue