C prefix postfix incr dec

August 27, 2009 at 02:12:57
Specs: Windows XP
the expression sum = (++a) - (--a) is evaluated to
0. if a is given value 9..can any one explain me

See More: C prefix postfix incr dec

Report •

August 27, 2009 at 04:16:09
Expressions like this, where a side effect affects the same variable without any intervening sequence points, has "Undefined Behaviour" according to Standard ISO C (or C++). That means that anything can happen. You should look up "sequence point" and "undefined behaviour" to learn more.

Report •
Related Solutions

Ask Question