#pragma setlocale("chs") - 已经失效了吗?
#pragma setlocale("chs")
#include<stdio.h>
#include<stdlib.h>
#include<Windows.h>
#include<locale.h>
void main()
{
wchar_t wstr[100] = L"hello 你好";
wprintf(L"%ls", wstr);
getchar();
}
我知道用 //setlocale(LC_CTYPE, "chs"); /*setlocale(LC_ALL, "zh-CN");*/ 可以, 但想问一下 在最上面使用 #pragma setlocale("[locale-string]")
这种方式是失效了吗?
PS: 我VS2015下编译通过, 但打印出来后面你好两字 还是 问号..