首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include main() { char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′}; printf("%d%d\n",strlen(p),strlen(q));} 以下叙述中正确的是
有以下程序 #include main() { char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′}; printf("%d%d\n",strlen(p),strlen(q));} 以下叙述中正确的是
admin
2010-09-05
18
问题
有以下程序
#include
main()
{ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};
printf("%d%d\n",strlen(p),strlen(q));}
以下叙述中正确的是
选项
A、在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B、由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3
C、由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3
D、由于p和q数组中都没有字符串结束符,故长度都不能确定
答案
A
解析
在给p和q数组赋初值时,系统会自动添加字符串结束符,从题目中可以看出数组p和q都有3个字符,所以长度均为3。
转载请注明原文地址:https://kaotiyun.com/show/ASWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
现有如下一段程序:PrivateSubCommand1_Click() x=UCase(InputBox("输入:")) SelectCasex Case"A"To"C" Print"考核通过!"
程序运行时,当在空文本框中依次输入1234时,窗体上显示的是()。PrivatesubTextl_Change()PrintTextl;EndSub
考生文件夹下有一个工程文件sjt5.vbp。运行程序后,从文件中读出数据,将其放入一个5×5的二维数组a中。请编写程序,找出数组a中每行的最大值及该值在行中的次序(列下标),并将所找到的结果分别保存到一维数组b、c中(a中第一行的最大值保存在b(1)中,最
下列叙述中正确的是
设工程文件包含两个窗体文件Form1.frm、Form2.frm及一个标准模块文件Module1.bas。两个窗体上分别只有一个名称为Command1的命令按钮。Form1的代码如下:PublicxAsIntegerPrivateSubFo
设窗体上有1个名称为HScroll1的水平滚动条,其Max、Min属性分别设置为100、1;有2个名称分别为Option1、Option2的单选按钮,其标题分别为"30"、"50";还有下面程序代码:PrivateSubOption1_Cli
窗体上有一个名称为CD1的通用对话框控件和由四个命令按钮组成的控件数组Command1,其下标从左到右分别为0、1、2,3,窗体外观如图所示。命令按钮的事件过程如下:PrivateSubCommandl_Click(IndexA
以下关于控件的叙述中,正确的是
语句DimArr(-2To4)AsInteger所定义的数组的元素个数为( )。
在数据库管理系统提供的数据语言中,负责数据模式定义的是
随机试题
行政诉讼中人民法院审理上诉案件,需要改变原审判决的,对被诉行政行为应如何处理()
Word2010中,用户可以切换到____________选项卡,设置文档的“主题”,用以快速改变文档的整体外观。
精神分裂症患者最具有特征性的障碍是
下列各项中属于突发公共卫生事件定义内容的是
()用立法的形式确立了素质教育。
A、 B、 C、 D、 A观察字体笔画,其规律依次递增为2、3、4、5,故推断出选项一定为6画,答案为A。
戴高乐
日本全国划分为多少个行政区域?
Theterm"disruptivetechnology"ispopular,butiswidelymisused.Itrefersnotsimplytoaclevernewtechnology,buttoone
当并行接口芯片8255A被设定为方式2时,其工作的I/O口
最新回复
(
0
)