Skip to main content
gamedev.net
🔒 Locked

fread problem

Started by widggman Feb 17, 2007 at 9:31 PM 1 replies 950+ views
Original Post
widggman
widggman
Hi! I have an "unknown" problem with the function "fread". I'm trying to fill a buffer, which size is 0x40000. When I try to fill it, with this line: fread(buffer, 1, 0x4000, fileIn); It's return the size 287h. After, I check for error with "ferror" but, there's not error. After that, I tried to read my buffer in part (loop until I fill it) but the second time I used "fread" in that case, it's return 0, which mean there's not byte read. Do you have a suggestion to pass over that problem ??

InetRoadkill
InetRoadkill
did you open the file with "rb" for the file mode?
widggman
widggman
Thanx... It's working...

I was just using "r"...

thanx again.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.