网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
有以下程序:#include struct st{ int x,y;} data[2]={1,10,2,20};main(){ struct st *p=data; printf(%d,,p->y); printf(%d,(++p)->x);}程序运行的结果是(  )。
A

10,1

B

20,1

C

10,2

D

20,2


参考答案

参考解析
解析:
题目在定义结构体st的同时便定义了结构体数组data。可知data[0]={1,10},data[1]={2,20}。结构体指针p指向数组的首地址,指向data[0],++p则指向data[1],所以输出p->y,(++p)->x即输出data[0].y和data[1].x。从初始化列表中可以看出,这两个值分别是10和2。答案选择C选项。
更多 “单选题有以下程序:#include struct st{ int x,y;} data[2]={1,10,2,20};main(){ struct st *p=data; printf(%d,,p-y); printf(%d,(++p)-x);}程序运行的结果是(  )。A 10,1B 20,1C 10,2D 20,2” 相关考题
考题 有以下程序#include stdio.hstruct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main(){ int i;p=a;for(i=1;i=2;i++) {printf("%d,",p-x); p=p-y;}}程序的运行结果是A)20,30,B)30,17C)15,30,D)20,15,

考题 有以下程序#include stdio.hstruct st{ int x,y;} data[2]={1,10,2,20};main(){ struct st *p=data;printf("%d,",p-y); printf("%d\n",(++p)-x);}程序的运行结果是A)10,1B)20,1C)10,2D)20,2

考题 有以下程序#include stdio.hstruct ord{ int x,y; } dt[2]={1,2,3,4};main(){ struct ord *p=dt;printf("%d,",++p-x); printf("%d\n",++p-y);}程序的运行结果是A)1,2B)2,3C)3,4D)4,1

考题 下面程序的输出结果为( )。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],80dt[3]}; main() { p=aa; printf("%d\n",++p-x); printf("%d\n",(++p)-x); printf("%d\n",++(*p-y)); }A.10 B.50 C.51 D.60 20 60 60 70 20 21 21 31

考题 有以下程序:struct s{ int x,y; }data[2]={10,100,20,200};main(){ struct s *p=data;printf("%d\n",(++p)-x);}程序运行后的输出结果是( )。A.10 B.11 C.20 D.21

考题 (37)有以下程序#include stdio.hstruct ord{ int x,y;} dt[2]={1,2,3,4};main(){ struct ord *p=dt;printf (“%d,”,++p-x); printf(“%d\n”,++p-y);}程序的运行结果是A)1,2 B)2,3 C)3,4 D)4,1

考题 有下列程序:#includestdi0.hstructst{intx,Y,date[2]={1,10,2,20};voidmain( ){structst*p=date;printf(%d,,p-y);printf(%d\n,(++p)-x);}程序的运行结果是( )。A.10,1B.20,1C.10,2D.20,2

考题 有以下程序 include struct tt { int x; struct tt *y; } *p; s 有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } *p; struct tt a[4]= {20,a+ 1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1; i<-2; i++) { printf("%d,", p->x ); p=p->y; }A.20,30,B.30,17C.15,30,D.20,15,

考题 下列程序的输出结果是( )。 include main() { struct st { int y,x,z; }; union {long 下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }A.6, 2B.6, 4C.8, 4D.8, 6

考题 有以下程序:includestruct tt{int x;struct tt*y;}*p;struct tt a[4]={20,a+1,15,a+2, 有以下程序: #include<stdio.h> struct tt {int x;struct tt*y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a} main() { int i; p=a; for(i=1;i<=2;i++){printf("%d",p->x);p=P->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30D.20,15

考题 有以下程序includestruct ord{ int x,y;} dt[2]={1,2,3,4};mare(){struct ord*p=dt; p 有以下程序 #include<stdio.h> struct ord { int x,y;} dt[2]={1,2,3,4}; mare() { struct ord*p=dt; printf("%d,",++p->x); printf("%d\n",++p->y); } 程序的运行结果是______。A.1,2B.2,3C.3,4D.4,1

考题 有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。A.10,1B.20,1C.10,2D.20,2

考题 有以下程序 #includestdio.h struct tt (int x;struct tt*y;)*P; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main { int i; p=a; for(i=l;i=2;i++){printf("%d,",p-x);P =p-y;} } 程序的运行结果是( )。A.20,30,B.30,17,C.15,30,D.20,15,

考题 有以下程序#includestdio.hstruct tt(int x;struct tt*y;)*P;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main{ int i;p=a;for(i=l;i=2;i++){printf(%d,,p-x);P =p-y;}}程序的运行结果是( )。A.20,30,B.30,17,C.15,30,D.20,15,

考题 有以下程序:includestruct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a 有以下程序: #include<stdio.h> struct tt { int x;struct tt *y;} *p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main() {int i; p=a; for(i=1;i<=2;i++) {printf("%d,",p->x);p=p->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30,D.20,15,

考题 有以下程序#include stdio.hstruct st{ int x, y, z;} data[2]={3,10,2,20,15,7};main(){ struct st *p=data; printf("%d,", p-y); printf("%d\n",(++p)-x); }程序的运行结果是A.10,3 B.20,3 C.10,20 D.20,2

考题 有以下程序: #includestdio.h 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)); } 程序运行后的输出结果是( )。A.1,2B.4,1C.3,4D.2,3

考题 以下程序的输出结果是includestruct st{ int x;int *y;}*p;int dt[4]={10,20,30,40};s 以下程序的输出结果是 #include<stdio.h> struct st { int x;int *y;}*p; int dt[4]={10,20,30,40}; struct st aa[4]={50,dt[0],60,dt[0],60,dt[0],60,dt[0],}; main() { p=aa; printf("%d\n",++(p->x));}A.10B.11C.51D.60

考题 以下程序的输出结果是( )。include struct s { int x,y; } a[2]={10,100,20,200}; main() { struct s *p=data; printf("%d\n",++(p->x)); } A、10B、11C、20D、21

考题 有以下程序 struct s { int x,y; } data[2]={10,100,20,200}; main() struct s *p=data; printf("%d\n",++(p->x)); 程序运行后的输出结果是A.10B.11C.20D.21

考题 有以下程序#includestdio.hstruct tt{int x; struct tt *y;}*p;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main(){int I;p=a;for(i=1;i=2;i++) printf(“%d”,p-x); p=p-y;}程序的运行结果是( )。A.20,30B.30,17C.15,30D.20,15

考题 (37)有以下程序#include stdio.hstruct ord{ int x,y;}dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++(p-x)); printf("%d\n",++(p-y));}程序运行后的输出结果是A)1,2B)4,1C)3,4D)2,3

考题 以下C语言程序的输出结果是( )。struct s{int x,y;}data[2]={10,100,20,200};main( ){struct s*p=data;p++;printf(“%d\n”,++(p->x));}A.10 B.11 C.20 D.21

考题 单选题有以下程序:#include struct S{ int a,b;}data[2]={10,100,20,200};main(){ struct S p=data[1]; printf(%d,++(p.a));}程序运行后的输出结果是(  )。A 10B 11C 20D 21

考题 单选题有以下程序:#include struct S{ int x,y;};main(){ struct S data[3] = {4,3,2,0,8,1}; int i; for(i=0;i3;i++)  printf(%d%d;,data[i].x, data[i].y1); printf();}程序运行后的输出结果是(  )。A 41;20;80;B 41;22;64;C 40;21;80;D 43;20;81;

考题 单选题有以下程序#include struct tt{ int x; struct tt *y;} *p;struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};main(){ int i; p=a; for(i=1;i=2;i++) {  printf(%d,,p-x);  p=p-y; }}程序的运行结果是(  )。A 20,15,B 30,17,C 15,30,D 20,30,

考题 单选题有以下程序:#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,p-next-n);}程序运行后的输出结果是(  )。A 2,3B 2,4C 3,4D 4,6