[求助]关于删除模块的问题
删除模块void delete()
{ struct music s;
FILE *fp;
int i,n,k,w0=1,w1;
n=load();
do{k=-1;
printf_face();
for(i=0;i<n;i++)
if((i!=0)&&(i%10==0))
{printf("\n\n Remember name which needed delete.Press any key to continue\n");
getch();
puts("\n\n");
printf_one(i);}
do{printf("\n\n Enter name that you want to delete!\n");
scanf("\n\t%s",s.name);
for(i=0;i<n;i++)
if(strcmp(s.name,song[i].name)==0)
{k=i;
s=song[i] ;}
if(k==-1)
{printf("\n no find!");}}
while(k==-1);
printf("Are you sure to delete %s 1)sure 2)no\n",song[k].name);
scanf("%d",&w1);
if(w1==1)
{song[k].name[0]=0;song[k].editor[0]=0;song[k].singer[0]=0;song[k].year='\0';song[k].month='\0';
printf("\n successful^_^,\n\n Delete another?\n\n\n 1)Yes 2)No\n");
scanf("%d",&w0);}
else menu() ;
if(w0!=1)
save(n);}
while(w0==1);
menu();}
有10条记录,删除一条,浏览时只剩9条记录信息,但仍显示有10条记录
浏览模块
void browse()
{int i,j,n;
n=load() ;
printf_face();
for(i=0;i<n;i++)
if((i!=0)&&(i%10==0))
{printf("\n\n Press any key to continue:\n");
getch();
puts("\n\n\n");}
for(i=0;i<n;i++)
printf_one(i);
printf("\n\t\tThere are %d record.\n",n);
printf("\nPress any key to back:\n\n");
getch();
menu();}
望高手指点指点,新手啊