Sunday, July 26, 2009

How do i find out the 'EOF'(End of File) of a binary file like .bmp in C programmimng?

I need to read and write a .bmp file in C.


But for gettin the image pixel data, i must know the end of file to run the loop that many times.


So please let me know...

How do i find out the 'EOF'(End of File) of a binary file like .bmp in C programmimng?
BMP Files have three sections:





BITMAPFILEHEADER bfh; // 14 bytes includes file length


LPBITMAPINFO lpbmi = NULL; // 40 bytes includes data length


Data – palette first when appropriate
Reply:while( ! feof(filepointer) )





or use fseek if you mean that you want to go straight to the end of the file.


No comments:

Post a Comment