C history question

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Fri Sep 29 00:31:11 AEST 1989


In article <29557 at news.Think.COM> barmar at think.COM (Barry Margolin) writes:
|
|	allok = allok && a[i++] > b[j++]
|
|then the side effects on i and j would be different from
|
|	allok &= a[i++] > b[j++]
|
|The first must NOT increment i and j when allok is true, while the
|second MUST increment them in any case.

  What are you saying here? The & and && operators work diferently. I
also think the *effect* of thew first example would be easier to
understand if you wrote:
  if (!allok) allok = a[i++] > b[j++]
but that's a matter of preference. Yes I know, some people like
(allok == 0) better.
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.lang.c mailing list