From 5b5e9b695e2e54f4244225371765a52223887393 Mon Sep 17 00:00:00 2001 From: 18408001236 <1327631753@qq.com> Date: Sat, 12 Jan 2019 18:57:23 +0800 Subject: [PATCH] ninth commit --- 删除函数.c | 51 -------------------------------------------------- 排序函数.c | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 51 deletions(-) delete mode 100644 删除函数.c create mode 100644 排序函数.c diff --git a/删除函数.c b/删除函数.c deleted file mode 100644 index fedd83e..0000000 --- a/删除函数.c +++ /dev/null @@ -1,51 +0,0 @@ -void del() -{ - FILE *fp; - int i,j,count=0; - char ch[2]; - char name[15]; - if((fp=fopen("data.txt","r+"))==NULL) - { - printf("can not open\n"); - return; - } - while(!feof(fp)) - if(fread(&addrinfo[count],LEN,1,fp)==1) - count++; - fclose(fp); - if(count==0) - { - printf("no record!\n"); - return; - } - display(); - printf("please input the name"); - scanf("%s",&name); - for(i=0;i0) + { + t=addrinfo[i]; + addrinfo[i]=addrinfo[j]; + addrinfo[j]=t; + } + if((fp=fopen("data.txt","w"))==NULL) + { + printf("can not open\n"); + return; + } + for(i=0;i