I've got a program like below:
#include <iostream>
using namespace std;
int main()
{
wcout << "abc" << endl;
cout << "你好" << endl;
cout << L"abc" << endl;
return 0;
}
My questions:
The first "wcout" has no problem, my question is: does wcout "automatically" convert to narrow char string "abc" into wchar_t string L"abc" in memory, and print it? How can I prove if such conversion exists or not?
The second "cout" print out a chinese charater string of "hello". It works as long as I set Chinese code-page in windows. No problem.
The third "cout" will print "??" or random character in my test. I'm curious, why "cout" could print other language characters successfully, but not wchar_t string? What's the core problem/difference here?
Thanks.