C history question
Bjorn Engsig
bengsig at oracle.nl
Mon Sep 18 21:52:19 AEST 1989
|In article <1687 at sunset.MATH.UCLA.EDU> pmontgom at math.ucla.edu (Peter Montgomery) writes:
|>shouldn't we be allowed to abbreviate this to
|> allok &&= a[i] > b[i];
Article <11046 at smoke.BRL.MIL> by gwyn at brl.arpa (Doug Gwyn) says:
|If allok is being used as a Boolean, as it should be in such a context,
|you can use &= instead. One less character to type, too.
No. I assume that &&= should only evaluate it's right hand if the lefthand
is nonzero.
|
|[Doug continues with other points about boolean (assingment) operators]
I agree with these, it would be too much for a very limited use. I would
write the above
if (allok)
allok = a[i] > b[i];
--
Bjorn Engsig, bengsig at oracle.nl, bengsig at oracle.com, mcvax!orcenl!bengsig
More information about the Comp.lang.c
mailing list