#include#include int main() { std::wstring myString; // Creating a wstring variable myString = L"Hello, World!"; // Setting the value of the wstring variable std::wcout << myString << std::endl; // Printing the wstring variable to the console return 0; }
#includeIn this example, we create two wstring variables 'firstName' and 'lastName' and concatenate them using the '+' operator. We then create a new wstring variable 'fullName' which contains both the first name and last name separated by a space. The value of 'fullName' is then printed to the console. Package library: The cpp wstring data type is a part of the standard library 'string' package which is included by default in C++. No additional package library is required to use the wstring data type in C++.#include int main() { std::wstring firstName = L"John"; std::wstring lastName = L"Doe"; std::wstring fullName = firstName + L" " + lastName; std::wcout << fullName << std::endl; return 0; }