c++ C-stringWhich of the following statements are correct? A

c++ C-string
Which of the following statements are correct?
A. A string literal is a C-string.
B. A C-string is a sequence of characters ending with a null terminator.
C. An array of characters is a C-string.
D. A C-string is a sequence of characters.
要答案+浅议的详解,谢谢,可以有追加
wangyu20021105 1年前 已收到1个回答 举报

安心真的安心 幼苗

共回答了15个问题采纳率:86.7% 举报

B.
字符串的定义是“ 有0或多个字符组成的有限有序队列”。
而同时,在C中,字符串会自动在末尾加上''用来标识字符串的结束。
A选项:意思是这个串(多个字符构成)就是所谓的C-string
C选项:字符串的存储形式多以字符数组的形式,但不是说一个字符数组就是一个C-string
D选项:缺失了'' 不能构成一个字符串

1年前

7
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.030 s. - webmaster@yulucn.com