选择题
有以下程序:
#include<stdio.h>
struct ball
{ char color[10];
int dim;};
main()
{ struct ball list[2]={{'white',2},{'yellow',3}};
printf('%s:%d\n',(list+1)->color,list->dim);
}
程序运行后的输出结果是
【正确答案】
B
【答案解析】结构体定义时初始化,list[0]={'white',2},list[1]={'yellow',3},(list+1)->color=list[1].color='yellow',list->dim=list[0].dim=2,因此,打印的结果是yellow:2。故答案为选项B。