资源简介
一个用c++编的简单的通讯录程序 入门的可以参考一下 很简单的 看看就能懂得 有运行程序 可以测试能不能用

代码片段和文件信息
/*
Name: 实现文件
Copyright:
Author: 荆志奇
Date: 21/05/09 22:16
Description:
*/
#include
#include “person.h“//头文件的库
#include
#include//文件的输入和输出流的库
#include//exit()的库
//#include//setw()的库
#include //这个库用来设置密码;
using namespace std;
Information::Information():head(NULL)//用来初始化链表
{
//有意留空
}
Information::~Information()//析构函数,用来释放自由内存空间
{
if(head!=NULL)
delete head;
}
void come()//用来访问head使其指向表头
{
Information s;
s.head=new person;
}
void Information::creat()
{
intptr here;
here=new person;
//head=new person;
cout<<“********************注意不能输入空格!*********************\n“;
cout<<“请添加联系人信息\n“;
cout<<“\t\t姓名:“;
cin>>here->name;
cout<<“\t\t性别:“;
cin>>here->sex;
cout<<“\t\t年龄:“;
cin>>here->age;
cout<<“ 电话号码:“;
cin>>here->num;
cout<<“\t\tQQ号:“;
cin>>here->QQ;
here->link=head;
head=here;
// delete here;
}
//按姓名查找
void Information::search1()
{
intptr here=head;
string the_name;
cout<<“输入要查找的姓名:“;
cin>>the_name;
if(here==NULL)
cout<<“搜索完毕,没有您要的信息。\n“;
else
{
while(here->name!=the_name&&here->link!=NULL)
here=here->link;
if(here->name==the_name)
{
cout< cout<<“\t\t性别:“;
cout<sex< cout<<“\t\t年龄:“;
cout<age< cout<<“ 电话号码:“;
cout<num< cout<<“\t\tQQ号:“;
cout<QQ< }
else
cout<<“对不起,没有您想要的信息!\n“;
}
//delete here;
}
//按号码查询
void Information::search2()
{
intptr here=head;
string the_num;
cout<<“输入要查找的电话号码:“;
cin>>the_num;
if(here==NULL)
cout<<“搜索完毕,没有您要的信息。\n“;
else
{
while(here->num!=the_num&&here->link!=NULL)
here=here->link;
if(here->num==the_num)
{
cout< cout<<“\t\t姓名:“;
cout<name< cout<<“\t\t性别:“;
cout<sex< cout<<“\t\t年龄:“;
cout<age< cout<<“\t\tQQ号码:“;
cout<QQ< }
else
cout<<“对不起,没有您想要的信息!\n“;
}
//delete here;
}
//修改联系人函数
void Information::modify()
{
intptr here=head;
string the_name;
cout<<“********************注意不能输入空格!*********************\n“;
cout<<“输入您想要更改的联系人姓名:\n“ ;
cin>>the_name;
if(here==NULL)
cout<<“搜索完毕,没有您要的信息。\n“;
else
{
while(here->name!=the_name&&here->link!=NULL)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 206 2009-06-04 21:48 程序\infile.txt
文件 1107 2009-06-04 22:07 程序\Makefile.win
文件 1414 2009-06-03 18:29 程序\person.h
文件 6166 2009-06-04 22:07 程序\实现文件.cpp
文件 14946 2009-06-04 22:07 程序\实现文件.o
文件 6298 2009-06-04 21:19 程序\应用程序.cpp
文件 8445 2009-06-04 21:19 程序\应用程序.o
文件 1160 2009-05-21 23:05 程序\简单的通讯录应用程序.dev
文件 486949 2009-06-04 22:07 程序\简单的通讯录应用程序.exe
目录 0 2009-12-28 18:40 程序
----------- --------- ---------- ----- ----
526691 10
- 上一篇:热电偶-热电阻分度表
- 下一篇:距离向量DV算法实现
相关资源
- Deep Belief Nets in C++ and CUDA C Volume 2 Au
- C++获取计算机的CPU ID,硬盘序列号等
- C++头文件转delphi工具 + 源码
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
评论
共有 条评论