Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c Subject: Re: comp.lang.c Keywords: fread, Message-ID: <9832@alice.UUCP> Date: 28 Aug 89 11:47:48 GMT References: <744@oucsace.cs.OHIOU.EDU> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 18 In article <744@oucsace.cs.OHIOU.EDU>, bchurch@oucsace.cs.OHIOU.EDU (Bob Church) writes: > 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. Your problem is that == binds more tightly than =, so that is equivalent to while (rtns = ((fread(buf,5,10,ioptr)) == 10)) Instead you should say while ((rtns = fread(buf,5,10,ioptr)) == 10) -- --Andrew Koenig ark@europa.att.com