开个最简单的Win32控制台工程,代码如下#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[]){
cout << "系统" << endl;
return 0;
}输出的竟然是 "绯荤粺"
faint!!!有没有那位便宜遇到过相同的问题。怎么解决。我的VS 是7.1.3091另外如果将 static const char szTxt[] = "系统"; 定义在.h中输出正常,
定义在.cpp中就是"绯荤粺"。晕死

解决方案 »

  1.   

    #include "stdafx.h"
    #pragma setlocale("chs")
    using namespace std;
    int _tmain(int argc, _TCHAR* argv[]){
    cout << "系统" << endl;
    return 0;
    }
      

  2.   

    不是这个问题。#pragma setlocale("chs")试过了,无效。
    static const char szTxt[] = "系统"; 定义在.h中输出就是 “系统”
    定义在.cpp中却成了"绯荤粺"。
      

  3.   

    我用#pragma setlocale("chs")解决过自己程序的中文问题,你这里遇到的问题太奇怪了。建议你在程序中打印出系统default language and user default language,看看有没有问题