Path: utzoo!attcan!uunet!yale!wald-david From: wald-david@CS.YALE.EDU (david wald) Newsgroups: comp.lang.c Subject: Re: down Message-ID: <45472@yale-celray.yale.UUCP> Date: 12 Dec 88 21:09:46 GMT References: <9142@smoke.BRL.MIL> Sender: root@yale.UUCP Reply-To: wald-david@CS.YALE.EDU (david wald) Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 17 In article <9142@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article slores%gables.span@umigw.miami.edu (Stanislaw L. Olejniczak) writes: >> while ( (c = getchar) != EOF) >> chcnt++ += (c == '\n'); ... >The final problem is that you say c is a char. In that case it can >never compare equal to EOF on many systems. getchar() returns an int, >not a char. Doesn't the expression (c = getchar()) have type (int) regardless of the type of c? Or will c being a char really prevent this comparison? ============================================================================ David Wald wald-david@yale.UUCP waldave@yalevm.bitnet ============================================================================