Path: utzoo!attcan!uunet!yale!wald-david From: wald-david@CS.YALE.EDU (david wald) Newsgroups: comp.lang.c Subject: Re: down Message-ID: <45476@yale-celray.yale.UUCP> Date: 12 Dec 88 21:33:29 GMT References: <843@quintus.UUCP> 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: 18 In article <843@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: > > for (chcnt = 0; (c = getchar()) != EOF; chcnt += c == '\n' ? 2 : 1) > ; Urgh. Yes, it's not *too* unreadable, yes it's correct, but if you're going to do it like that, why bother eliminating the while loop: while ((c = getchar()) != EOF) chcnt += (c == '\n' ? 2 : 1); And, precedence rules be damned, I'd put in the parentheses. ============================================================================ David Wald wald-david@yale.UUCP waldave@yalevm.bitnet ============================================================================