有如下程序段struct abc{ int a, b, c, s;};main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t);}程序运行后输出的结果是A.5 B.6 C.7 D.8

有如下程序段struct abc{ int a, b, c, s;};main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t);}程序运行后输出的结果是A.5 B.6 C.7 D.8


相关考题:

有以下程序: #includestdio.h #includestdlio.h void fun(int*pl,int*p2,int*s) { s=(int*)malloc(sizeof(int)); *s=*pl+*p2; free(s); } main( ) { int a=1,b=40,*q=&a; fun(a,b,q); printf("%d\n",*q); } 程序运行后的输出结果是( )。A.42B.0C.1D.41

以下程序段中,能够通过调用函数fun(),使main()函数中的指针变量p指向一个合法的整型单元的是( )。A.main() {int*p; fun(p); … } int fun(int*p) {int s; p=s; }B.main {int*p fun(p); … } iht fun(int**p) {int s; *p=s;}C.main() {int*p; fun(p); } int fun(int**p) {*p=(int*)malloc(2);}D.main() {int*p; fun(p); } int fun(int*p) {p=(int*)malloc(sizeo(int));}

有以下程序: void swap(char*x,char*y) {cbar t; t=*x; *x=*y; *y=t; } main() {char*s1="abc",*s2="123"; swap(s1,s2);printf("%s,%s\n",s1,s2); } 程序执行后的输出结果是( )。A.123,abcB.abc,123C.1bc,a23D.321,cba

有以下程序 void swap(char* x,char *y) {char t; t= *x; *X= *y; *y=t; } main() {char*s1:"abc",*s2="123"; swap(s1,s2);printf("%s,%s\n",s1,s2); } 程序执行后的输出结果是A.123,abcB.abc,123C.1bc,a23D.321,cba

有以下程序 void swap(char *x,char *y) {char t; t=*x;*x=*y;*y=t; } main() {char *s1="abc",*s2="123"; swap(s1,s2); printf("%s,%s\n",s1,s2); } 程序执行后的输出结果是______。A.123,abcB.abc,123C.1bc,a23D.321,cba

若有如下程序: sub(int *t,int a[3][4]) { int m,n; for(m=0;m<3;m++) for(n=0;n<4;n++) { *t=a[m][n];t++;} } main() { int*t,s[3][4)={{1,2,3),{4,5,6),{7,8,9}}; t=(int*)malloc(50); sub(t,s); printf("%d,%d\n",t[4],t[7]); } 则程序运行后的输出结果是( )。A.4,7B.4,0C.5,8D.程序错误

若有如下程序: int s[3] [3]={'a','b','C','d','e','f','g','h','i'},*t; main() {t:(int*)malloc(sizeof(int)); sub(t,s); printf("%c\n",*t); } sub(int*p,int b[][3]) {*p=b[2][1]; } 则程序运行后的输出结果是( )。A.dB.eC.hD.b

有以下程序:includevoid fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3, 有以下程序: #include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,B) ; printf("%d\n",*b+1); } 程序的输出结果是( )A.2B.3C.4D.5

有以下程序:void swap (char *x,char *y){char t; t=*x,*x=*y;*y=t;}main(){char* s1="abc",*s2="123"; swap(s1,s2); printf("%s,%s\n",s1,s2);}程序执行后的输出结果是( )。A.123,abcB.abc,123C.1bc,a23D.321,cba