原创 C中printf计算参数是从右到左压栈的

2009-12-24 13:03 2140 2 2 分类: MCU/ 嵌入式

#include <stdio.h>


void main()
{
int arr[] = {6,7,8,9,10};
int *ptr = arr;
*(ptr++) += 123;
printf("%d,%d\n",*ptr,*(++ptr));
}


==============================


C中printf计算参数是从右到左压栈的,所以",*ptr,*(++ptr)"是一样的。


root@kyon-desktop:/tmp# ./test



8,8

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
2
关闭 站长推荐上一条 /1 下一条