若有以下程序:
#include “stdio.h”
struct we
{int a;
int *b;
}*p;
main()
{static int x0[]={11,12},x1[]={31,32};
static struct we x[2]={100,x0,300,x1};
p=x;
printf(“%d,%d,%d,%d\n”,*p->b,p->a,++p->a,(p++)->a);}
最后一条输出语句若分成四条语句分别输出,结果为什么不同?
若有以下程序:
#include “stdio.h”
struct we
{int a;
int *b;
}*p;
main()
{static int x0[]={11,12},x1[]={31,32};
static struct we x[2]={100,x0,300,x1};
p=x;
printf(“%d,%d,%d,%d\n”,*p->b,p->a,++p->a,(p++)->a);}
最后一条输出语句若分成四条语句分别输出,结果为什么不同?
你必须先 登录才能发表评论。
这与printf()中的数据入栈顺序有关