APL/APL1.2/Dev1.2/Fichiers/Records.c
2021-11-30 15:07:19 +01:00

21 lines
480 B
C

#include <stdio.h>
#include <stdlib.h>
int main() {
int a;
int tab[10];
FILE* flux;
flux = fopen("/export/home/an21/vieirae/APL/APL1.2/Dev1.2/Fichiers/top10", "r");
if (flux == NULL) {
printf("accès au fichier impossible !");
return EXIT_FAILURE;
}
for (int i = 0;i<10;i++){
fread (&a,4,1,flux);
fread (&tab, 1, 3,flux);
printf ("\| %09d \| %s \|\n",a,tab);
}
fclose(flux);
return EXIT_SUCCESS;
}