Code:
for(i=0; i<256; i++){
for(j=0; j<256; j++){
_image[i][j] = fgetc(_source);
}
}
done:
I think it might be best if you broke out of this loop once you hit EOF. Otherwise if it's a small file, most of your array locations will be set to EOF. The only way I could think of, was to use a goto. You could also use two break statements, but it's not as simple.
Code:
for(i=0; i<256; i++){
for(j=0; j<256; j++){
_image[i][j] = fgetc(_source);
if (_image[i][j] == EOF)
{
_image[i][j] = 0;
goto done;
}
}
}
done:
Code:
>while(j<=i){
This should be:
while(j<i){