以下程序的运行结果是() #include[stdio.h] structord { intx,y; }dt[2]={1,2,3,4}; main() { structord*p=dt; printf("%d ",++p->x); printf("%d\n",++p->y); }
A: 12
B: 23
C: 34
D: 41
A: 12
B: 23
C: 34
D: 41
举一反三
- #includestructord{intx,y;}dt[2]={1,2,3,4};voidmain(){structord*p=dt;printf("%d,",++P->x);printf("%d,",++P->y);}程序的运行结果是(). A: 1,2 B: 2,3 C: 3,4 D: 4,1
- 下面程序的输出结果为()structst{intx;int*y;}*p;intdt[4]={10,20,30,40};structstaa[4]={50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3]};main(){p=aa;printf("%d",++p->x);printf("%d",(++p)->x);printf("%d",++(*p->y));}
- 有下列程序: #include<stdio.h> struct ord int x,y;)dt[2]=1,2,3,4; main() struct ord*p=dt; printf("%d,",++p->x);printf("%d,",++p->y); 程序的运行结果是( )。 A: 1,2 B: 2,3 C: 3,4 D: 4,1
- 以下程序输出结果是____。struct student{short int x ; short int *y;} *p ;short int dt[4]={ 10 , 20 , 30 , 40 };struct student a[4]={50,&dt[0],60,&dt[1],70 ,&dt[2],80,&dt[3]} ;...p=a;printf("%d ",++p->x); printf("%d ",(++p)->x); printf("%d\n",++(*p->y)); }
- #include [stdio.h]main( ){ int a[ ]={1, 2, 3, 4, 5, 6}; int x, y, *p; p = &a[0]; x = *(p+2); y = *(p+4); printf(“*p=%d, x=%d, y=%d\n”, *p, x, y);} 运行结果为_____________