第一范文网 - 专业文章范例文档资料分享平台

数据结构课程设计(通讯录制作)

来源:用户分享 时间:2025/5/26 1:27:17 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

printf(\

}

void display(struct address *info) /*输出传入结点函数*/

{

printf(\

printf(\ printf(\ printf(\ printf(\ printf(\} void search(void) /*查找函数*/

{ char name[40]; struct address *info; 请输入要查找的姓名:\输入欲查找的姓名*/

gets(name); info=find(name); if(!info)

printf(\姓名不存在\\n\果没找到,显示Not found*/

else

欢迎共阅

printf(\

找到,显示该结点资料*/

}

void save(void) /*保存函数*/

{

FILE *fp;

/*生成文件*/ if(!fp) {

printf(\nSaveing ……\\n\ info=start;

while(info) /*把链表写入文件*/

address),1,fp); info=info->next;

}

printf(\

{

fwrite(info,sizeof(struct printf(\

return; }

fp=fopen(\struct address *info;

display(info); /*如果

欢迎共阅

fclose(fp);/*链表全部写入文件后,关闭文件*/

}

void load() /*调用预存文件函数*/

{

struct address *info,*temp=0;

char *p;

FILE *fp; /*打开文件*/ if((fp=fopen(\

printf(\调用文件*/ size=sizeof(struct address); /*为结点分配内存*/

start= (struct address *)malloc(size); if(!start) /*如果读取失败,返回*/

exit(0);

info=start;

} {

printf(\

{ printf(\

return; }

register int t, size;

欢迎共阅

p=(char*)info;

while((*p++=getc(fp))!=EOF)

*p++=getc(fp);

info->next=(struct address *)malloc(size);

if(!info->next)

return; info->prior=temp; temp=info; info=info->next; p=(char*)info; temp->next=0; last=temp; start->prior=0;

fclose(fp); printf(\

}

} }

{ printf(\{

for(t=0;t

欢迎共阅

搜索更多关于: 数据结构课程设计(通讯录制作) 的文档
数据结构课程设计(通讯录制作).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c8fa3w0drmq7d82u9zjlx7yogl1itk200iqh_6.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top