Domanda

Does string::size return the number of array elements needed to represent the string, or the number of glyphs required to render the string? Does wstring behave the same?

È stato utile?

Soluzione

It returns the number of char/wchar_t in the array. This allows a std::string to be encoded in utf-8 which, as a single char, may have no meaning.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top