同意,应该是10,这题考的是++在函数前后的区别

来源: 2004-06-28 15:24:19 [旧帖] [给我悄悄话] 本文已被阅读:

in print out statement, a++ hasn't done the arithmetic operation yet, so the result should be the same as a.
before the statement of ++a, a++ has done already, so a is changed as 11.
In ++a, the arithmatic operation should be done before print out statement, so 11 + 1 is 12, which is the new value of a.

Forgot the terminological name of such kind of question, but the theory should work in this way.

Correct me, please, if I am wrong.