CFile读取txt问题
我有一个txt文件,内容如下(都是采用CString存储的):
姓名 年龄 电话 QQ号 家庭住址
张三 23 19876543210 21345678 北京
采用CFile读取,代码如下:
CFile file("information.txt",CFile::modeRead);
int length;
length=file.GetLength();
char *pBuf=new char[length];
UINT ByteRead=file.Read(pBuf,length);
file.Close();
//-------数据在编辑框中显示-------//
GetDlgItem(IDC_READINFOR)->SetWindowText(pBuf);
然后在编辑框中显示,结果只显示到张三,从数字开始都不能显示。
麻烦哪位高手指点,谢谢!