Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!decwrl!purdue!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: down Message-ID: <9142@smoke.BRL.MIL> Date: 11 Dec 88 06:07:21 GMT References: Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 21 In article slores%gables.span@umigw.miami.edu (Stanislaw L. Olejniczak) writes: > while ( (c = getchar) != EOF) > chcnt++ += (c == '\n'); The main problem is that getchar is a function-like macro, requiring usage of a parenthesized argument list (containing no arguments), i.e. getchar() The next problem is that the result of chcnt++ is not a modifiable lvalue, so you cannot assign to it. Split the statement into two parts. 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. >... told me this would be too complex for a compiler. Well, if it weren't for the other problems, I would say that any C compiler that cannot handle expressions that complex is not worth using. Seriously!