You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
579 B
34 lines
579 B
#pragma once
|
|
#ifndef CONTACT_MANAGER_H
|
|
#define CONTACT_MANAGER_H
|
|
|
|
#include <string>
|
|
#include<vector>
|
|
|
|
// 声明联系人结构体
|
|
struct Contact {
|
|
int id;
|
|
std::string name;
|
|
std::string phone;
|
|
};
|
|
|
|
// 声明联系人管理类
|
|
class ContactManager {
|
|
private:
|
|
std::vector<Contact> contacts; // 存储联系人的向量
|
|
|
|
public:
|
|
// 添加联系人
|
|
void addContact();
|
|
|
|
// 显示通讯录
|
|
void displayContacts() const;
|
|
|
|
// 查找联系人
|
|
void findContact() const;
|
|
|
|
// 删除联系人
|
|
void deleteContact();
|
|
};
|
|
|
|
#endif // CONTACT_MANAGER_H
|