I just tested
int a=10
printf("a=%d a++=%d ++a=%d",a, a++,++a);
The gcc's output is:
a=12 a++=10 ++a=12
How to explain this? No matter which direction, the arguments are pushed into the stack, this result is not reasonable.
totally confused
所有跟帖:
•
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