What's the value of i++ + i++??

It's undefined. Basically, in C and C++, if you read a variable twice in an expression where you also write it, the result is undefined. Don't do that. Another example is:

v[i] = i++;

 

Related example:

f(v[i], i++);

 

Here, the result is undefined because the order of evaluation of function arguments are undefined.

posted on 2012-04-26 17:14  肯定;爱  阅读(157)  评论(0编辑  收藏  举报