首页 通讯录管理系统C++课程设计

通讯录管理系统C++课程设计

举报
开通vip

通讯录管理系统C++课程设计#include #include #include using namespace std; struct contactsInfo//定义一个自引用结构类型 { char name[20]; char address[50]; int telephoneNo; char postcood[7]; contactsInfo*next; }; class cperson { private: contactsInfo*head; contactsInfo*nail; public:...

通讯录管理系统C++课程设计
#include #include #include using namespace std; struct contactsInfo//定义一个自引用结构类型 { char name[20]; char address[50]; int telephoneNo; char postcood[7]; contactsInfo*next; }; class cperson { private: contactsInfo*head; contactsInfo*nail; public: cperson(){head=NULL;nail=head;} void insertInfo();//插入 void delteInfo(char*strName);//删除 void searchInfo(char*strName);//查找 void displaycperson();//显示 void displayMenu();//显示菜单 }; void cperson::insertInfo() { contactsInfo*pdata=new contactsInfo; cout<<"请输入姓名:"; cin>>pdata->name; cout<<"请输入地址:"; cin>>pdata->address; cout<<"请输入电话:"; cin>>pdata->telephoneNo; cout<<"请输入邮政编码:"; cin>>pdata->postcood; if(head==NULL) { head=pdata; nail=pdata; pdata->next=NULL; } else { nail->next=pdata; pdata->next=NULL; nail=pdata; } cout<name,strName)!=0) pdata=pdata->next; if(pdata==head) head=pdata->next; else { contactsInfo*pdeletNode=head; for(;;pdeletNode=pdeletNode->next) if(pdeletNode->next==pdata) break; pdeletNode->next=pdata->next; } delete pdata; cout<name,strName)) { pdata=pdata->next; } cout<<"查询结果:"<name<<"地址:"<address<<"联系电话:"<telephoneNo<<"邮政编码:"<postcood<name<address<telephoneNo<postcood<next; } cout<---------通讯录---------<"<>opeNo; switch(opeNo) { case '1': { testInfo.insertInfo(); break; } case '2': { char*str=new char; cout<<"输入你要查找人的姓名:"; cin>>str; testInfo.searchInfo(str); break; } case '3': { char*str=new char; cout<<"输入你要删除人的姓名:"; cin>>str; testInfo.delteInfo(str); break; } case '4': { testInfo.displaycperson(); break; } case 0: { cout<<"操作结束,退出系统,谢谢使用!!!"<
本文档为【通讯录管理系统C++课程设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_214245
暂无简介~
格式:doc
大小:36KB
软件:Word
页数:4
分类:计算机考试
上传时间:2011-12-15
浏览量:248