"Cesar Rabak" wrote in message news:eoj0u8$148$1@aioe.org... > Ludovic Brenta escreveu: >> Jean-Pierre Rosen a �crit : >>>> A question: I see all the time things like "if (.. < ..)" in C - are >>>> the >>>> parentheses required there ? >>> Yes, they are - because C has no "then" keyword. There must be something >>> to tell the compiler where the expression ends... >> >> Not to mention that the parentheses may contain several expressions >> separated by the comma operator, some or all of which may have side >> effects, and only the last of which actually controls the if >> statement... for example: >> >> if (a = 1, b = a, c = --a, (a = --b) == c) { >> ... >> } >> >> Ah, the joy of obfuscated programming :) :) :) >> > Would you believe that: > > if (a = 1) { > ... > } > > Is semantically valid C, but because it is very easy to mistake this when > the intended was: > > if (a == 1) { > ... > } > > That there are tools to look for and signal this!? A lot of C compiler will warn you about constructs such as if (a=1) { ... }