基于c语言设计的人事档案管理系统
while(fread(&empd,sizeof(struct employee),1,fp)) { n++; }
temp=(struct employee)));
rewind(fp);
fread(temp,sizeof(struct employee),n,fp); fclose(fp);
if((fp=fopen("employee.txt","w"))==NULL) {printf("Error Create new telefon.dat file"); return; } else {
fclose(fp);
fp=fopen("employee.txt","a"); for(i=0;i<n;i++) {
if (strcmp(temp[i].name,)==0) fwrite(&emp1,sizeof(struct employee),1,fp); else
fwrite(&temp[i],sizeof(struct employee),1,fp); } } } }
fclose(fp);
printf("操作完成按任意键返回\n");
employee
*)malloc(n*(sizeof(struct