I'm trying to manipulate images using c, and trying to fully understand fseek()
and fread()
mechanisms.
Why fseek
did not change the address of point even it affected the fread
function but did not change the point address or increase it?
Here is a simple example
int main()
{
char *x[5]={"axxxx","aaaa","hxxx","rrrrr","xsdsdd"};
char *point=x;
char buffer[65]={0};
fread(buffer,6,1,point); //Here fread copy "axxx"
fseek(point,5,SEEK_CUR); //Here fseek increase point by five bytes
fread(buffer,6,1,point); // Here fread do nothing copy nothing
printf("%s\n",buffer); // buffer contain "axxx" first fread call
printf("%x\n",point); // point address did not changed because of fseek
printf("%x",x); //x still the same as point pointer
return 0;
}