请看看读二进制总是乱码
请看看读二进制总是乱码
<<<<<写二进>>>>>>>
CFile cfile;
CString pFileName =_T("c:\\test.dat");
cfile.Open(pFileName, CFile::modeReadWrite | CFile::typeBinary)
char pbuf[4]="err";
cfile.Write( pbuf, 4 );
<<<<<读二进>>>>>>>
CFile cfile;
CString pFileName =_T("c:\\test.dat");
cfile.Open(pFileName, CFile::modeReadWrite | CFile::typeBinary)
char pbuf[4];
UINT nBytesRead = cfile.Read( pbuf, 4 );
CString str;
str.Format(_T("%s"),pbuf);
MessageBox(str);
为什么读出来的二进制是乱码!
谢谢:)