C++问题急需解决,高手帮忙a !

来源:百度知道 编辑:UC知道 时间:2024/06/14 04:22:02
“编写一个通讯录管理器,通讯录中的信息包括姓名,地址,邮编,电话1,电话2,电子邮件地址。该通讯录管理器应具有信息的添加,删除,修改,查找"功能我们的作业,有好多不会,希望高手指点,著我完成作业

#include <iostream>
#include <string>
using namespace std;
#define NULL 0
class ContectList{//通讯录
struct People{
string name;
string add;//地址
string zip;//邮编
string tel1;//电话1
string tel2;//电话2
string email;//邮箱地址
People*next;
};
People*head;
People*p;
public:
ContectList();
~ContectList();
void Add();//添加
void Del();//删除
void Edit();//修改
void Find();//查找
void Show();
};
int main()
{
ContectList t;
t.Add();
t.Add();
t.Edit();
t.Find();
t.Del();
return 0;
}
ContectList::ContectList(){
head=new People;
head->next=NULL;
p=head;
}
ContectList::~ContectList(){
p=head->next;
while(p){
head->next=p->next;
delete p;
p=head->next;
}
delete head;
}
void ContectList::Add(){