代码改变世界

关于字符串库的operator""s

2020-04-16 15:11  CenYu  阅读(1)  评论(0)    收藏  举报

内嵌 '\0' 字符的字符串字面量初始化 string 会使用构造函数basic_stringconst CharT* s,const Allocator& alloc = Allocator(); ,并在首个空字符停止。这可通过指定不同的构造函数,或通过使用 operator""s 避免