首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> struct ball { char color[10]; int dim; }; main( ) { struct ball list[2] = {{"white", 2
有以下程序 #include <stdio.h> struct ball { char color[10]; int dim; }; main( ) { struct ball list[2] = {{"white", 2
admin
2020-11-27
46
问题
有以下程序
#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);
}
程序运行后的输出结果是
选项
A、yellow:3
B、yellow:2
C、white:2
D、white:3
答案
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选项
转载请注明原文地址:https://kaotiyun.com/show/K43p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下正确的字符串常量是
若各选项中所用变量已正确定义,fun()函数中通过return语句返回一个函数值,下列选项中错误的程序是()。
设有定义:chars[10];inti=0;,以下不能将一行(不超过100个字符)带有空格的字符串正确读入的语句或语句组是()。
下列关于软件工程的描述中正确的是
以下叙述中正确的是
以下叙述中正确的是
若有定义:inta,b:通过语句scanf("%d;%d",&a,&b);能把整数3赋给变量a,5赋给变量b的输入数据是
设二叉树共有375个结点,其中度为2的结点有187个。则度为1的结点个数是
两个或两个以上模块之间关联的紧密程度称为
随机试题
急性中毒患者处于昏迷状态时禁忌采用
人工流产综合征的原因是由于
小儿出现高热,面部青紫,尤以鼻柱、两眉间及口唇四周为甚,多属于
()对有效风险管理承担最终责任。
商业银行通常采用留置作为担保方式。()
Itamazesmewhenpeopleproclaimthattheyarebored.Actually,itamazesmethatIameverbored,orthatanyofusare.With
RS232C是由电子工业协会(EIA,Electronic Industries Association)制定的(268)之间的接口标准,它规定的电平的表示方式为(269)。当使用RS232C连接相关设备时,电缆的长度不应超过(270)米。当用RS232C
有算术表达式((a+b)-c/(d+e)+f)*(g+h),其前缀和后缀表达式分别为(7)。
Backin1985,ViktorCherkashinwasaseniorKGBofficerattheSovietEmbassyinWashington.Intheshadowyworldofespionage,
1Women,byvirtueoftheavailabilityofsuchoutletsascryingfortheexpressionofemotion,arelikelytosufferfromfew
最新回复
(
0
)