Re: C/C++ Ambiguity in Order of Evaluation



On Sun, 24 Jun 2007 07:40:22 +0200, in comp.lang.c , "¬a\\/b" <al@xxx>
wrote:


ev=evalute

what about
t1=ev(a); t2=ev(b); t3=t1*t2; t4=ev(c); t5=t3+t4; x=t5;

the semicolons introduce sequence points.

what about x= ++a() * --b() + ++c();

Error - you can't increment a function.

t1=++ev(a()); t2=--ev(b()); t3=t1*t2; t4=++ev(c()); t5=t3+t4; x=t5;

Ditto.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.



Relevant Pages