On Thu, Jun 17, 1999 at 02:09:59AM -0400, Kenneth C. Finney wrote: > Yes, that is 'legal' C, but any decent compiler would complain that > nothing tangible is really happening with most of that line, and it > should always only generate the assignment in the first paren pair. Absolute codswallop! Any compiler that did what you suggest would be seriously broken! The semantics of the comma operator, the short circuit boolean operators and the treatment of side effects are all well defined by the ANSI standard, and have not changed since DMR built his first C compiler. As for your subsequent post, while your example does do what is intended, it's not called a "conditional assignment" (the assignment is quite unconditional, it's the value expression on the RHS of the assignment that's conditional) and it will typically generate significantly larger code than my suggestions. As far as readability goes, your example is undoubtedly superior, however if readability is a priority, and compact code is a bonus, you can't beat the code that the original poster wanted to improve on (simple if - then - else). -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3355 8333 +61 7 3355 8334 --------------------------------------------------------------------------- HI-TECH C: compiling the real world.