ifstream打开文件出现乱码的问题
const char* filename="WINPY.TXT";
std::ifstream inFile(filename);
if (!inFile){
cout<<endl<<"Failed to open file"<<filename;
return resultSec;
}
int isFound=1;
string word;
while(!inFile.eof()&&isFound){
inFile>>word;cout<<word;// 这里我将word打出来测试,可测试的结果是word为乱码。请问高手怎么回事?
if (word[0]==zwSec[i]){
isFound=0;
resultSec.insert(resultSec.length(),word,2,word.length());
}
}