void output people hum Вывод информации тестируемых из файла FILE fope

 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
26
27
28
29
30
31
32
33
34
35
36
void output(people *hum)//Вывод информации о тестируемых из файла
{FILE *f;
f = fopen("People.txt","r");
do
{ printf( "Тестируемый №");
fscanf(f,"%d",&hum->kol);
if(feof(f))break;
printf( "%d\n",hum->kol);
fscanf(f,"%s",&hum->sorname);
printf( "Фамилия:\n");
printf( "%s\n",hum->sorname);
printf( "Имя:\n");
fscanf(f,"%s",&hum->name);
printf( "%s\n",hum->name);
printf( "Отчество:\n");
fscanf(f,"%s",&hum->patronymic);
printf( "%s\n",hum->patronymic);
printf( "Место работы:\n");
fscanf(f,"%s",&hum->profession);
printf( "%s\n",hum->profession);
printf( "Ваш возраст:\n");
fscanf(f,"%d",&hum->age);
printf( "%d\n",hum->age);
printf( "Дата проходения тестирования:\n");
fscanf(f,"%d",&hum->date);
printf( "%d\n",hum->date);
printf( "IQ\n");
fscanf(f,"%d",&hum->iq);
printf( "%d\n",hum->iq);
hum=hum+1;
}while(!feof(f));
fclose(f);
getch();
}