首页 试题详情
单选题

下面程序的输出结果为()。 struct st { int x; int *y; } *p; int dt[4]={10,20,30,40}; struct st aa[4]={ 50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3] }; main() { p=aa; printf("%d\n", ++p->x ); printf("%d\n", (++p)->x); printf("%d\n", ++( *p->y)); }

A10 20 20

B50 20 20

C51 60 21

D60 70 31

正确答案:A (备注:此答案有误)

相似试题

  • 单选题

    下面程序输出结果struct st{ int x;int *y;} *p;int dt[4]={10,20,30,40};struct st aa[4]={ 50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3] };main(){ p=aa;printf(%d n, ++p->x );printf(%d n, (++p)->x);printf(%d n, ++( *p->y));}

    答案解析

  • 单选题

    8、 有以下程序struct STU{char name[10];int num;};void f1(struct STU c){ struct STU b={LiSiGuo,2042};c=b;}void f2(struct STU *c){ struct STU b={SunDan,2044}; *c=b;}main( ){ struct STU a={YangSan,2041},b={WangYin,2043}; f1(a);f2(&b); printf(%d %d n,a.num,b.num);} 执行后输出结果是 (

    答案解析

  • 单选题

    有以下程序  #include   struct ord  { int x,y;}dt[2]={1,2,3,4};  main()  {  struct ord *p=dt;  printf(%d,,++(p->x)); printf(%d n,++(p->y));  }  程序运行后输出结果是(

    答案解析

  • 单选题

    下列程序输出结果是(struct abc{ int a, b, c; };main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t;t=s[0].a+s[1].b;printf(%d n,t);}

    答案解析

  • 单选题

    有以下程序#include main(){struct node{int n;struct node *next;} *p;struct node x[3]={{2,x+1},{4,x+2},{6,NULL}};p=x;printf(“%d,”,p->n);printf(“%d n”,p->next->n);}程序运行后输出结果是(

    答案解析

热门题库