, тогда как String :: size ()-простое чтение». And then I found that, there is '_M_string_length' (declared private at line 156 in bits/basic_string.h)
I made the _M_string_length member public in the class (and commented the private one).
But,
Код: Выделить всё
std::string str="Hello"
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/59262691/why-do-basic-stringsize-m-string-length-in-same-class-return-differe[/url]
Мобильная версия