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