Mail Archives: djgpp/1997/07/18/12:23:10
A. Sinan Unur wrote:
>heretic AT polbox DOT com wrote:
>> So, I wanted to have error checking and I wrote something like
>>
>> if ( fread(blah,blah,blah) == -1 )
>> {
>> oh_no_error ();
>> }
>>
>
>i think it is an error in the docs. AFAIK, fread is supposed to return
>0, not EOF, precisely because the return value is size_t, and 0
>signifies no bytes read.
Well, AFAIK, fread is an ANSI function, so the standard should be able to
bring enlightenment. Can someone with a copy help us out here?
Nate Eldredge
eldredge AT ap DOT net
- Raw text -