I started to study c ++ well. I saw the second chapter about wchar_t wide byte and wcout. I made a try,
# Include <iostream>
Int main ()
{
STD: wcout. imbue (STD: locale ("CHS "));
STD: wcout <L "Unicode, hello! "<STD: Endl;
Return 0;
}
Declaration, the editor used at this time is C-free and the compiler is mingw, but there are two errors. What errors have you forgotten, it is probably because "wcout is not a member of STD" "illegal byte sequence" is hard to remember. The encoding and wcout errors are caused. I checked from the Internet for half a day that the original mingw does not support wcout and wcin, so I used stlport to start a series of configurations. Since C-free has few materials, I used codeblocks as the editor.
Even if it is there, msys cannot find it. Install and configure mingw and msys and stlport is not much said, in the http://hi.baidu.com/jasonlyy/blog/item/1c9caaee9b2b702a62d09fee.html is very detailed.
the output is correct, but it is strange that even if it was configured yesterday, the error "illegal byte sequence" still exists, and the other option is configured in the compiler and debugger options- finput-charset = GBK. However, if this configuration is removed today, it can run correctly. codeblocks is still not familiar with codeblocks...