From: Spiro Trikaliotis (Spiro.Trikaliotis_at_gmx.de)
Date: 2001-01-03 12:04:37
Hello to all who answered, > On Tue, Jan 02, 2001 at 07:15:32PM +0100, Spiro Trikaliotis wrote: > > Forgive me, but if my memory serves me right, C (at least pre-ANSI) does NOT > > define the order in which this will be evaluated, so the second part (c!=62) > > might be evaluated BEFORE the first part with the assignment, in that case, > > this will NOT evaluate to the expected condition. > That is incorrect. C evaluates boolean expressions as shortcuts with each > boolean operator being a sequence point. If the left operand is enough to > determine the value of the expression result, all others will not get > evaluated. Because of this, one can write things like Oh yeah, I must admit after reading the C language reference, that my statement is NOT true. Possibly, it's my fault, because I learned C with K&R, 1st edition, which is pre-ANSI. In that case, my statement was correct, anyway, after reading the (ANSI-)C reference ("sequency points"), I must admit that I'm not correct. Thank you for answering, as I now know more than before, and can write programs with much less if()-statements than before... ;-) Spiro. ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo_at_musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:38 CET