From: Dave H. <dhy...@br...> - 2004-09-14 17:16:26
|
Hi Brian, > The second test, does not behave as expected; and that=20 > certainly isn't because of ambiguous precedence or > order of evaluation issues. Sure it is. In the statements c =3D 0; c =3D c++; The increment can occur either before or after the assignment. You get two different answers based on when it occurs. c++ evaluates to 0.=20 If the increment occurs, and then the assignment, 0 (the result of evaluating c++) will be stored into c, over-writing the incremented value. If the assignment occurs first, then c will be assigned 0 and then the increment will occur yielding 1 in c. Two different outcomes from two different orders of evaluation. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/=20 |