代码改变世界

随笔档案-2020年04月

关于字符串库的operator""s

2020-04-16 15:11 by CenYu, 1 阅读, 收藏,
摘要: 内嵌 '\0' 字符的字符串字面量初始化 string 会使用构造函数basic_string( const CharT* s,const Allocator& alloc = Allocator() ); ,并在首个空字符停止。这可通过指定不同的构造函数,或通过使用 operator""s 避免 阅读全文