2 字符串-E

* * 济南大学信息科学与工程学院 * C++ 程序设计 主讲人:赵亚欧 Ise_zhao@ujn.edu.cn 济南大学 信息科学与技术学院 Chapter 6 Strings 6.1 C-strings(C 风格字符串)- review C-string: a string is an array of characters (elements of type char) with the null character \0 in the last element of the array The string literal Hello actually contains 6, rather than 5,characters. char greetings[6] = {H, e, l, l, o, \0}; char greetings[ ] = Hello; char greetings[ ] = \Hello\, I said.; cout greetings; 6.1 C-strings - review If specify the size of the array and the string is shorter than this size, the remaining elements of the array are initia

文档评论(0)

1亿VIP精品文档

相关文档