z****4 发帖数: 194 | 1 我刚才试了一下,用i=5做试验,返回结果是10,请问原理。。。 |
z****4 发帖数: 194 | 2 按理说右++是同级,那么先右后左,i++ return 5,然后i变成6。。。
【在 z****4 的大作中提到】 : 我刚才试了一下,用i=5做试验,返回结果是10,请问原理。。。
|
i****s 发帖数: 1152 | 3 这跟compiler有关系8
C# 是11
i's final value is 7 |
q******0 发帖数: 15 | 4 Undefined.
The is related to the concept of "sequence point". e.g.
a[i] = i++
because there is no sequence point specified for the assignment, increment
or index operators, you don't know when the effect of the increment on i
occurs.
Same reason for i++ + i++ |
c****p 发帖数: 6474 | 5 下次再有人问这题直接大嘴巴抽他。
【在 z****4 的大作中提到】 : 我刚才试了一下,用i=5做试验,返回结果是10,请问原理。。。
|
r****t 发帖数: 10904 | |