首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include #include main() {charstr[][20]={"One*World","One*Dream!"},*p=str[1]; printf("%d,",strlen(p));printf("%s\n",p); }
有以下程序: #include #include main() {charstr[][20]={"One*World","One*Dream!"},*p=str[1]; printf("%d,",strlen(p));printf("%s\n",p); }
admin
2019-12-17
24
问题
有以下程序:
#include
#include
main()
{charstr[][20]={"One*World","One*Dream!"},*p=str[1];
printf("%d,",strlen(p));printf("%s\n",p);
}
程序运行后的输出结果是( )。
选项
A、10,One*Dream!
B、9,One*Dream!
C、9,One*World
D、10,One*World
答案
A
解析
p是指向二维字符数组第二行One*Dream!的数组指针,所以长度是10,打印输出的也是该字符串。
转载请注明原文地址:https://jikaoti.com/ti/L5G0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
给定程序MODI1.C中函数fun的功能是:求出两个非零正整数的最大公约数,并作为函数值返回。例如,若给hum1和num2分别输入49和21,则输出的最大公约数为7;若给num1和num2分别输入27和81,则输出的最大公约数为27。请
请编写函数fun,其功能是:计算并输出下列多项式的值:例如,在主函数中从键盘给n输入50后,输出为:s=1.718282。注意:要求n的值大于1但不大于100。部分源程序在文件PROG1.C中。请勿改动主函数mai
下列给定程序中函数fun的功能是:根据整型形参m,计算如下公式的值:例如,若m的值为5,则应输出1.463611。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
给定程序中函数fun的功能是:首先把b所指字符串中的字符按逆序存放,然后将a所指字符串中的字符和b所指字符串中的字符,按排列的顺序交叉合并到e所指数组中,过长的剩余字符接在c所指的数组的尾部。例如,当a所指字符串中的内容为’’abedefg’’,b所指字符
给定程序中,函数fun的功能是:在任意给定的9个正整数中找出按升序排列时处于中间的数,将原数据序列中比该中间数小的数用该中间数替换,位置不变,在主函数中输出处理后的数据序列,并将中间数作为函数值返回。例如,有9个正整数:15723
下列给定程序中,函数fun的功能是:根据整形参m的值,计算如下公式的值。例如,若m中的值为5,则应输出0.536389。请改正程序中的错误,使它能得出正确的结果。注意:部分源程序在文件MODI1.C中,不要改动main函数,
若有定义:intw[3][5];则以下不能正确表示该数组元素的表达式是
以下选项中合法的常量是
在学生管理的关系数据库中,存取一个学生信息的数据单位是
随机试题
A.缩宫素B.丙酸睾酮C.垂体后叶素D.呋塞米E.雌二醇后备母猪,10月龄,未见发情,应选用的催情药物是
下列描述中,对肺结核的描述,正确的是
患者,女,畏光、发热和呕吐,入院时血液学检查示轻度淋巴细胞减少,C反应蛋白和白细胞计数正常。白细胞计数增多常见于
民事法律行为的形式主要有()。
将现金存入银行应编制()。
单层工业厂房的结构组成一般分为( )结构。
商品流通企业管理费用不多的,可不设“管理费用”科目,相关核算内容可并入“销售费用”科目进行核算。()
如图4,该画面中左五站立的人物是()。
阅读下面材料,并回答问题:材料1:一天,三岁的萨米走进幼儿园的积木区小组。“那是我们的指挥塔”,他指着一个书架的角落对万斯和琳内特说:“开始倒数”,萨米发出命令。他用一个小的木制积木假装对讲机,并对着它讲“5,6,2,4,1,发射!”琳内特让一个
Themostcrucialway,however,ofimprovingthelabourcoststructureatSAH(SydneyAirportHotel)wastofindbetter,morepr
最新回复
(
0
)