#include <stdio.h>
#include <stdlib.h>
#define size 512
int main ()
{
char img[size][size];
int x,y,j;
FILE *fi;
fi=fopen("lena.raw","r+");
if (fi!=NULL)
{
for(x=0;x<size;x++)
for(y=0;y<size;y++)
img[x][y]=getc(fi);
fclose(fi);
} else
printf("Il file non esiste\n");
for (j=0; j<size; j++) {
printf("%c",&img[0][j]);
}
printf ("\n\n\n");
for (j=0; j<size; j++) {
printf("%c",&img[size-1][j]);
}
fflush (stdin);
getchar();
}

Rispondi quotando