我用CFILE打开一个普通的TXT文件,该文件只有3个BYTE,aaaCFile *file;
char *cbuffer;
UINT nBytes = file->GetLength();
printf("file->GetLength():%d\n",nBytes);
cbuffer = (char*)malloc(nBytes);
memset(cbuffer,0,nBytes);
file->Read(cbuffer,nBytes);
file->Close();
printf("cbuffer:%s\n",cbuffer);输出的结果却是:
file->GetLength():3
cbuffer:aaa葺葺葺葺?
后面多了一串乱起八遭的东西,这是怎么回事啊?