請問高手,一下程序輸出結果應該是什麽:
#include
int a=10,b=10;
main()
{
printf("\na++=%d ++a=%d",a++,++a);
printf("\nb++=%d",b++);
printf("\n++b=%d",++b);
return 0;
}
我的結果是:
a++=11 ++a=12
b++=10
++b=12
第一行的a++=11我想不通,怎麽搞地?
謝謝!
請教:關於c
所有跟帖:
•
回複:不是11,你說是幾?
-深海魚遊-
♀
(20 bytes)
()
06/28/2004 postreply
00:53:25
•
回複:所以問你
-深海魚遊-
♀
(68 bytes)
()
06/28/2004 postreply
02:57:21
•
回複:請教:關於c: COMPILER BUG!
-紅辣椒-
♀
(87 bytes)
()
06/28/2004 postreply
10:36:07
•
回複:回複:請教:關於c: COMPILER BUG!
-深海魚遊-
♀
(34 bytes)
()
06/28/2004 postreply
10:49:54
•
那你可以用單步跟蹤到PRINTF函數的內部看看它怎麽搞的
-VC是帶源碼的-
♀
(0 bytes)
()
06/28/2004 postreply
12:55:34
•
回複:那你可以用單步跟蹤到PRINTF函數的內部看看它怎麽搞
-深海魚遊-
♀
(178 bytes)
()
06/28/2004 postreply
13:41:44
•
這回知道為什麽大家討厭◎◎了
-是挺煩人的-
♀
(108 bytes)
()
06/28/2004 postreply
14:52:29
•
同意,應該是10,這題考的是++在函數前後的區別
-theApp-
♀
(457 bytes)
()
06/28/2004 postreply
15:24:19
•
你一個能代表大家嗎?
-想找不痛快?-
♀
(0 bytes)
()
06/29/2004 postreply
01:12:51
•
我用visual c++ 6.0
-意味深長-
♀
(37 bytes)
()
06/29/2004 postreply
10:13:28
•
回複:我用visual c++ 6.0: 對的.
-紅辣椒-
♀
(217 bytes)
()
06/29/2004 postreply
12:33:53
•
回複:回複:我用visual c++ 6.0: 對的.
-clowhand-
♀
(773 bytes)
()
06/29/2004 postreply
20:45:35
•
one more comment
-clowhand-
♀
(274 bytes)
()
06/29/2004 postreply
20:53:17
•
don't understand?
-pleaseexp-
♀
(295 bytes)
()
06/30/2004 postreply
08:01:28
•
回複:don't understand?
-clowhand-
♀
(380 bytes)
()
06/30/2004 postreply
19:49:17
•
totally confused
-goingcraz-
♀
(259 bytes)
()
06/30/2004 postreply
08:58:40
•
3! anwsers. Avoid!
-紅辣椒-
♀
(13 bytes)
()
06/30/2004 postreply
17:23:18
•
能解釋嗎?
-真糊塗啦啦...-
♀
(0 bytes)
()
06/30/2004 postreply
19:38:44
•
回複:能解釋嗎?
-紅辣椒-
♀
(317 bytes)
()
06/30/2004 postreply
19:47:15
•
這樣看來,還是VC++合理些
-意味深長-
♀
(0 bytes)
()
06/30/2004 postreply
19:46:01
•
Finally! got the answer,
-fianlly-
♀
(81 bytes)
()
07/01/2004 postreply
08:43:49