从文件读入中文字符到宽字符数组
void main()
{
wchar_t ch1=L '哀 ';
if(ch1==L '哀 ') //////////////////////true
wchar_t ch2[5];
ifstream ifile( "1.txt ",ios::in); //1.txt中只有一个中文字符 '哀 '。
if(!ifile){cout < < "can not open ";return 0;}
while(ifile.good())
{
ifile.getline((char*)ch,10, ' ');
if(ch[0]==L '哀 ') ///false
if(ch[0]==0xb7a9) ///true
}
}
我想要把中文字符直接读到宽字符数组里,就像手动附值ch2[]={L '哀 '},使ch[0]==L '哀 ' 为true
请问该怎么办??
[解决办法]
帮顶,接分