I tried this:
std::wcout << L"\u20AC" << L"\n";
B开发者_开发问答ut it only prints the newline. Am I not doing it right?
I have a function that takes const wchar_t* and I tried passing L"\u20AC" to it and it crashes at the part where I do wctombs_s on it. I think it's getting a NULL instead of the widechar.
L"\u20AC" is not a character, it is a string of wide characters. If you want print a single wide character to the console, you should write std::wcout << '\u20AC' << L"\n";
But if you want to print a string of wide chars then std::wcout << L"\\u20AC"<< L"\n";
精彩评论