Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!umich!yale!think!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!EE.ECN.PURDUE.EDU!bevis From: bevis@EE.ECN.PURDUE.EDU (Jeff Bevis) Newsgroups: comp.sys.amiga.tech Subject: Re: Fonts and freeing memory Message-ID: <9001182253.AA18421@en.ecn.purdue.edu> Date: 18 Jan 90 22:53:25 GMT References: <1990Jan17.013417.20587@haven.umd.edu> Sender: daemon@ucbvax.BERKELEY.EDU Organization: Purdue University Engineering Computer Network Lines: 36 In article <1990Jan17.013417.20587@haven.umd.edu>, louie@sayshell.umd.edu (Louis A. Mamakos) writes: > >According to my K&R, first edition in Appendix A "C Reference Manual", >section 7.11: > > 7.11 Logical AND operator > > {\it logical-and-expression: > expression && expression} > > The && operator groups left-to-right. It returns 1 if boths its > operands are non-zero, 0 otherwise. Unlink &, && guarantees > left-to-right evaluation; moreover the second operand is not > evaluated if the first operand is 0. > >So the example code posted works just fine. > >louie [red, embarrassed face omitted] I have obviously been using memory-destructive drugs. Indeed I was wrong... and I apologize for spreading bogus myth.... I would rather change my previous statement to the form of "using two if's instead of the && would be clearer and less confusing" instead of what I did state. In some languages, the statement in question would present a problem of ambiguity, but thanks to K&R, not in C. At any rate, I am *never* going to loan out my K&R reference again, for if I hadn't, I would've looked this up first.... :-( +--------------------------------+--------------------------------------------+ | Jeff Bevis | "But I don't like spam!" | | bevis@en.ecn.purdue.edu | Give me Amiga or nothing at all. | +--------------------------------+--------------------------------------------+