• Advertisement
Sign in to follow this  

wrong bytes?

This topic is 4618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. im having a problem. i dont know if my image file (my own format) is 64 bytes or 6.10kb. in my program it says 64 bytes (and print the file):
long i=0;
while (!feof(file))
{
i++;
printf("%c",fgetc(file));
}
printf("\n%ld Bytes.",i-(i!=0));
and in windows explorer it says 6.10kb. also, i cant find the header (the file begin with PSG) in notepad. but i do find it in my program. in the file i've used hex, chars, compressions, bgcolor, and a header of course. the weird is, when i test it with a small program that contains background and many pixels only- it works well in both notepad and my program (compiler: TC3, windows: XPro). what is going on? (tell me if a source code is needed, the code is just fine. i used longs and no ints). thanks, pex.

Share this post


Link to post
Share on other sites
Advertisement
I doubt it could account for such a large discrepancy but are sure that the file is opened in binary mode?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement