#include "stdio.h" #include "stdlib.h" int main(void) { printf("Very simple program for reading image values into an array ....\n"); FILE *image_in; int r,c; unsigned char image[10][10]; /*image size in rows and columns*/ image_in=fopen("mouse10.raw","r+b"); /*open binary image for reading*/ if (image_in==NULL) printf("File not found ... \n"); else fread(image, 1, 100, image_in); { for (r=0;r<10;r++) { for (c=0;c<10;c++) { printf("%d\t",image[r][c]); /* print values with tabs*/ } printf("\n"); /* print new line after each row*/ } fclose(image_in); } printf("Finished\n"); return (0); }