Hi. Can anyone help me to distinguish the reason behind this case? Thanks a lot.
I initialized the following variable: unsigned char temp=0;
In the following statement block, I managed to get the results that I wanted to be displayed on the first go (traversing the while loop on the first run).
However, on the 2nd run, the temp being printed equals to the last temp printed in the first run.
while
{
// other print statements
// statement to get rlen
for(i=0; i<rlen; i++)
{
fread( (char*) &temp, sizeof(temp), 1 ,input);
printf("%x ", temp);
}
}
I've thought of it might be because of pointer problems? I am not sure. I am not any good at this, just a beginner. Please help. Thanks.