APL/APL1.2/Dev1.2/Fichiers/Image.c
2021-12-02 15:42:49 +01:00

27 lines
635 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <graph.h>
int main(int argc, char const argv[])
{
FILE *flux;
int a=0;
int b=0;
int cpt=0;
int nb_pix=0;
int color;
flux = fopen("image.bin", "r");
fread(&a,sizeof(int),1,flux);
fread(&b,sizeof(int),1,flux);
printf("%d\n", a);
printf("%d\n", b);
nb_pix = a*b;
while(cpt <= nb_pix)
{
fread(&color, sizeof(int),1,flux);
printf("couleur : %d\n", color);
cpt=cpt+1;
}
return EXIT_SUCCESS;
}