我已经编写了以下代码来表示Windows控制台输出中基于Unicode的字符,但是当我运行代码时,VS向我显示了以下信息,提示错误:
Debug Assertation Failed
Expression: buffer_size % 2 == 0
我的代码:
#include <iostream>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
auto main() -> decltype(0) {
bool status = _setmode(_fileno(stdout), _O_U16TEXT);
if (status == true)
{
std::cout << "Everything is working fine." << std::endl;
}
wchar_t Message[] = L"\x263a";
std::cout << Message << std::endl;
return 0;
}