master
1052720016@qq.com 6 years ago
parent 6bbd51dab0
commit a4efc92696

@ -33,7 +33,7 @@ void credit(int n)
printf("请输入用于存放文件的路径及路径名:");
scanf("%s",fpname);
getchar();
fp=fopen(fpname,"w+");
fp=fopen(fpname,"a+");
head=(struct student *)malloc(sizeof(struct student));
printf("请输入学生学号 姓名 性别 出生年 月 日 地址 电话 e_mail:");
scanf("%d %s %c %d %d %d %s %s %s",&head->number,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail);
@ -67,9 +67,9 @@ int show2(int n)
for(i=0;i<n;i++)
{
fscanf(fp,"%d %s %c %d %d %d %s %s %s",&head->number,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail);
printf("%d %s %c %d %d %d %s %s %s",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail);
fclose(fp);
printf("%d %s %c %d %d %d %s %s %s",&head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail);
}
fclose(fp);
}
int search1(int n)
{
@ -114,7 +114,6 @@ int search2(int n)
fscanf(fp,"%d %s %c %d %d %d %s %s %s",&head->number,head->name,&head->sex,&(*head).birthday.year,&(*head).birthday.month,&(*head).birthday.day,head->address,head->tel,head->E_mail);
if(strcmp(checkname,head->name)==0)
{
for(i=0;i<n;i++)
fprintf(fp,"%d %s %c %d %d %d %s %s %s",head->number,head->name,head->sex,(*head).birthday.year,(*head).birthday.month,(*head).birthday.day,head->address,head->tel,head->E_mail);
fclose(fp);
return(1);

Binary file not shown.
Loading…
Cancel
Save