CString str("Unicode文件写文件!");
CFile nfile(_T("E:\\22.txt"),CFile::modeWrite);
BYTE temp[]={0xFF,0xFE}; //unicode文件头文件
nfile.Write(temp,2);
nfile.SeekToEnd();
int nlen = str.GetLength();
nfile.Write(str,nlen*2);// 字符长度*2
nfile.Close();
用这个方法写文件,简单快捷方便。。。
本文介绍了一种使用C++将Unicode字符串写入文件的简便技术,包括创建文件、写入Unicode文件头、计算字符串长度并写入文件、以及关闭文件的完整流程。
8459

被折叠的 条评论
为什么被折叠?



