来自 http://en.cppreference.com/w/cpp/string/basic_string/size
The number of
CharT
elements in the string.
什么是CharT
元素?
最佳答案
std::basic_string
是一个类模板,定义为
template<
class CharT,
class Traits = std::char_traits<CharT>,
class Allocator = std::allocator<CharT>
> class basic_string;
其中 CharT
是字符串存储的字符类型。所以 std::basic_string::size
返回字符串中 CharT
元素的数量。
关于c++ string::size 中的 CharT 元素是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50681173/