std::string s = "Hello, world!"; int len = s.length(); std::cout << "The length of the string is " << len << std::endl;
std::wstring s = L"こんにちは、世界!"; int len = s.length(); std::wcout << "The length of the string is " << len << std::endl;This code creates a `std::wstring` containing the Japanese text "こんにちは、世界!" and uses the `length` function to determine the length of the string, which is then printed to the console using wide-character output. Both of these examples use the C++ Standard Library, which is included with most C++ compilers.