Example:
#include <iostream> using namespace std; int main() { wchar_t en[] = L"Hello"; wchar_t ru[] = L"Привет"; //Russian language cout << ru << endl << en; return 0; }
This code only prints HEX-values like adress. How to print the wchar_t string?
Edit: This doesn’t work if you are trying to write text that cannot be represented in your default locale. :-(
Use std::wcout instead of std::cout.
std::wcout
std::cout
wcout << ru << endl << en;
2.1m questions
2.1m answers
60 comments
57.0k users