//HEADER
typedef struct tagHEADER
{
int type;
int bpp;
int nHeight;
int nWidth;
int Size;
} HEADER, *LPHEADER;
//DATA
typedef struct tagRGBA
{
unsigned char a,b,g,r;
} RGBA, *LPRGBA;
fread problem
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.
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
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement