英文: How to construct a `std::string` from a buffer that may or may not contain a null? 问题 以下是翻译好的部分:...
在C语言中,字符串是通过在字符序列的末尾添加一个空字符(‘\0’)来终止的。
英文: How does a String terminate in C? 问题 我知道在C语言中,字符串会以字符\0结尾。 然而,如果我这样做:char a[5]="abcd\n"...