const std::string s(5, '=');
constexpr basic_string( size_type count, CharT ch,
const Allocator& alloc = Allocator() );
const std::string s{5, '='};
constexpr basic_string( std::initializer_list<CharT> ilist,
const Allocator& alloc = Allocator() );
5
将被转换为一个char
,因此您的字符串大小将为2
。第一个字符将具有值5
,而另一个字符将是=
。
=
?换句话说,当你说“我得到了=
”时,你只显示了=
,而在它之前的0x05字符是不可打印的,我的理解正确吗? - Wyck=
?换句话说,当你说“我得到了=
”时,你只显示了=
,而在它之前的0x05字符是不可打印的,我理解得对吗? - undefined