int edit char file FILE struct info puipl int num system cls fopen fil

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
int edit(char* file)
{
FILE *f;
struct info puipl;
int num;
system("cls");
f=fopen(file,"r+b");
if(!f)
{
printf("opening error!!!\n");
system("pause");
return 1;
}
printf("Enter number of puipl whose results you want to delete\n");
scanf("%d",&num);
fseek(f,(num-1)*sizeof(puipl),SEEK_SET);
if(fread(&puipl,sizeof(puipl),1,f)){
fseek(f,-(sizeof(puipl)),SEEK_CUR);
puipl=input_puipl();
fwrite(&puipl,sizeof(puipl),1,f);
}
fclose(f);
system("pause");
return 0;
}