Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!adam@prophet.bbn.com From: adam@prophet.bbn.com Newsgroups: comp.lang.c Subject: Re: conditional expression evaluation question Message-ID: <2316@brl-adm.ARPA> Date: Tue, 13-Jan-87 12:34:41 EST Article-I.D.: brl-adm.2316 Posted: Tue Jan 13 12:34:41 1987 Date-Received: Wed, 14-Jan-87 00:36:41 EST Sender: news@brl-adm.ARPA Lines: 24 > For now, I am using the following ugly code: > > while (cp < end && triples < MINSKIP) { > if ((*cp | *(cp+1) | *(cp+2)) == 0) ++triples; > else triples = 0; > cp += 3; > } First of all I don't understand what is so ugly about this code. The other example with the *cp++'s was subtle and at worst confusing. This example is not. The only other objections to this second example that you might have is that it compiles to significantly more code, or that you don't like all the parentheses. The first of these other objections I cannot answer for you, but the second can be solved by using array notation as follows: while (cp < end && triples < MINSKIP) { if ((cp[0] | cp[1] | cp[2]) == 0) ++triples; else triples = 0; cp = &cp[3]; } -- Adam Stock