DEV/DEV1.1/TP12/records.c

19 lines
289 B
C
Raw Normal View History

2022-11-23 16:43:26 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
FILE *f;
f=fopen("top10","r");
int n;
char name[3];
for(int i = 0;i<10;i++)
{
fread(&n,4,1,f);
printf("%09d ",n);
fread(&name,1,3,f);
printf("%s \n",name);
}
fclose(f);
}