同意,應該是10,這題考的是++在函數前後的區別

本帖於 2004-06-29 08:23:49 時間, 由普通用戶 hamburg 編輯
回答: 請教:關於c深海魚遊2004-06-27 23:39:22

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.

請您先登陸,再發跟帖!