下列程序的输出结果是( )。 struct abc { int a, b, C; ); main() { struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=

admin2010-05-22  32

问题 下列程序的输出结果是(  )。    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);    }

选项 A、3
B、4
C、5
D、6

答案8

解析 street abc s[2]={{1,2,3},{4,5,6}};定义了结构型数组s,数组元素s[0]和s[1]都为结构abc型。因此s[0].a的值为1,s[1].b的值为5,所以t的值为6,选项D正确。
转载请注明原文地址:https://kaotiyun.com/show/5VWp777K
0

最新回复(0)