#includeIn this example, we have declared a wide string str and initialized it with "Hello World". The length function is called on the str object, and its value is printed to the console. Package Library The wstring length function is part of the Standard Template Library (STL) in C++. It is defined in the `#include using namespace std; int main() { wstring str = L"Hello World"; cout << "Length of the string is: " << str.length() << endl; return 0; }