首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有下列语句,编号分别是1、2、3、4, char s1 = "abcde"; //1 char s2[] = "abcde"; //2 char s3[4] = "abcde"; //3 char s4[5] = "abcde"; //4 其
有下列语句,编号分别是1、2、3、4, char s1 = "abcde"; //1 char s2[] = "abcde"; //2 char s3[4] = "abcde"; //3 char s4[5] = "abcde"; //4 其
admin
2020-07-23
20
问题
有下列语句,编号分别是1、2、3、4,
char s1 = "abcde"; //1
char s2[] = "abcde"; //2
char s3[4] = "abcde"; //3
char s4[5] = "abcde"; //4
其中错误的是
选项
A、2
B、1,3
C、1,3,4
D、1,2,3,4
答案
C
解析
字符串常量不能用来初始化字符变量,语句1错误;使用字符串常量初始化字符数组,系统自动根据初值个数确定数组长度,语句2正确;字符串常量"abcde"实际长度应该包括空字符’\0’,为6个字符,语句3、4语法错误;所以答案选C。
转载请注明原文地址:https://kaotiyun.com/show/vhyp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下4个语句:①cout
有如下程序:#include#includeusingnamespacestd;classWheel{public:Wheel(strings=
若为类MyClass重载运算符"+",下列声明中,错误的是
如下类定义:classAA{inta;public:intgetRef()const{return&a;}//①intgetValue()const{returna;}
当数据库中数据总体逻辑结构发生变化,而应用程序不受影响,称为数据的
软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是( )。
在数据库中,数据模型包括数据结构、数据操作和
按照“后进先出”原则组织数据的数据结构是()。
随机试题
患者,女,26岁。产后30天,左乳房肿痛,伴发热恶寒,口干,舌红苔薄黄,脉浮数。查体:左乳外上象限可扪及一硬块,皮肤微红压痛。诊断为急性乳腺炎,治疗应首选青霉素加
诊断心肌缺血的依据不包括
依据营业税的有关规定,下列说法中正确的有()。
系统调查结束后,作为阶段性总结,应写出()。在系统分析阶段,开发小组,画出了系统的数据流图,为了对数据流图中的各项数据进行定义,还应编写相应的()。
根据企业所得税法律制度的规定,下列关于收入确认的表述中,不正确的是()。
秘书辅助决策要具有针对性,必须首先充分理解领导的()。
下列说法错误的是()。
华夏市安泰区张某外出旅游,被海天市宝华区卫生防疫部门检测出患有恶性传染病,送去强制治疗。张某对卫生防疫部门采取的强制措施不服提起诉讼,有管辖权的法院是()。
下面不属于黑盒测试方法的是
Everyotherweekitseemsanewstudycomesoutthataddstoouralready-formidablestoreofparentalworries.Butevenbythose
最新回复
(
0
)