Archived

This topic is now archived and is closed to further replies.

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

Recommended Posts

I''m using fread to read in a file. But after about 800 bytes it tells me that it''s reached the end of the file. But as a matter of fact, the file size is 8.71 KB... How is this possible?? The file consists of a header, followed by the data.


{
int type;
int bpp;
int nHeight;
int nWidth;
int Size;

//DATA

typedef struct tagRGBA
{
unsigned char a,b,g,r;
} RGBA, *LPRGBA;

Because of this, I don''t no if my program actually would work. It should compress a bitmap using RLE, with alpha channel as run length. But please, don''t tell me to use another function, cuz I like this one better than the C++ stream classes

Share on other sites
Have you opened it to read in binary? I think in Windows it defaults to text, everywhere else its binary. If you should be reading in binary and you open it for text it will confuse the end-of-file symbol with something else and think the file is finished.

Share on other sites
Yeah, thanks, it works :D:D