请问高手,一下程序输出结果应该是什么:
#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