这是神马情况?
程序代码:
#include <iostream> int main() { wchar_t buf1[3] = L"中文"; wchar_t buf2[3]; char buf3[5]; std::wcin >> buf2; std::cin >> buf3; std::cout << std::endl << std::hex; std::cout << "buf1 : " << buf1[0] << buf1[1] << std::endl; std::cout << "buf2 : " << buf2[0] << buf2[1] << std::endl; std::cout << "buf3 : " << (wchar_t)buf3[0] << (wchar_t)buf3[2] << std::endl; std::cout << std::endl; std::wcout << "buf1 : " << buf1 << std::endl; std::wcout << "buf2 : " << buf2 << std::endl; std::cout << "buf3 : " << buf3 << std::endl; return 0; } /* 中文 中文 buf1 : c40 buf2 : d6d0 buf3 : ffd6ffce buf1 : buf2 : 中文 buf3 : 中文 Process returned 0 (0x0) execution time : 4.672 s Press any key to continue. */
输出结果为什么是这样的呢?