问题
问答题
#include<stdio.h> typedef struct abc {int a,b,c; }; main() {struct abe s[2]={{1,2,3),{4,5,6}}; int t=-s[0].a+s[1].b; printf("%d\n",t); }
答案
参考答案:
解析:4 #include<stdio.h> typedef struct abc{ int a,b,C; };/*定义一个结构体类型*/ main() {struct abc s[2]={{1,2,3},{4,5,6}};/*定义一个结构体数组s[2]并赋初值*/ int t=-s[0].a+s[1].b;/*引用结构体数组元素的成员进行计算,计算t的值*/ printf("%d\n",t); }