同意,應該是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.