27 lines
635 B
C
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;
|
|
}
|
|
|