求助 读取汉字,再输出,变成乱码
读取汉字,再输出,变成乱码。直接输出汉字,正常。。。
程序代码:
//#pragma execution_character_set("gbk")
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
int cnt = 0;
string str;
ifstream fin("a.txt", ios::in);
if (!fin) {
printf("The file is not exist!");
return -1;
}
while (getline(fin, str))
{
cnt++;
cout << str << endl;
}
str = "中文乱码";
cout << endl << str << endl << endl;
return 0;
}代码中第一行,启用也是一样。。。。
这几天,学什么。做什么,都特别,别扭。。。
是因为,换了VS2015吗,
VS2015和VS2010相比,特别卡。反应很慢!!!!!!









