comp.lang.c

Bob Church bchurch at oucsace.cs.OHIOU.EDU
Mon Aug 28 14:14:33 AEST 1989


I've just started reading this newsgroup so forgive me if this is
an old question. I am trying to get the return value of fread into
a variable. The following line
while (rtns = (fread(buf,5,10,ioptr)) == 10)
rtns being an integer works as long as their are
50 byte chunks of data left to be read. The problem is that the
value that I then in rtns after each pass is either 1 if
successful or 0 on the last pass when the data has all been read.
How can I get the actual number of items read into a variable that
I can then use in the fwrite command? 
Thanks,

Bob Church
att!oucsace!bchurch
or CS656 at OUACCVMB on the Bitnet



More information about the Comp.lang.c mailing list