setlocale

char *setlocale(int category, const char *locale);


If locale is a null pointer, setlocale queries, rather than sets, the international environment and returns a pointer to the string associated with the specifiedcategory. The program's current locale setting is not changed. 
setlocale( LC_ALL, NULL );

Sets the locale to the default, which is the user-default ANSI code page obtained from the operating system. 
setlocale( LC_ALL, "" );

如果locale为NULL, 则查询当前locale值.
如果locate为"", 则设置为操作系统默认值.

setlocale(LC_ALL, "");
wchar_t szbuf[] = L"你好, 世界!"; 
wprintf(L"%s ",szbuf);

如果没有语句setlocale( LC_ALL, "" ) 则无法输出汉字.

你可能感兴趣的:(String,null)