更新时间:2023-02-14 09:37:29
string
类有一个构造函数,它接受一个以 NULL 结尾的 C 字符串:
The string
class has a constructor that takes a NULL-terminated C-string:
char arr[ ] = "This is a test";
string str(arr);
// You can also assign directly to a string.
str = "This is another string";
// or
str = arr;