文件操作问题(打开读取数据)
ssboy 2004-03-22 02:07:50 void CDrawView::OnImport()
{
// TODO: Add your command handler code here
CStdioFile file;
CString filename;
CString str;
CFileDialog opendlg(true,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,".(*.txt)|*.txt|All Files(*.*)|*.*||",NULL);
if(opendlg.DoModal()==IDOK)
filename=opendlg.GetPathName();
if(file.Open(filename,CFile::modeReadWrite|CFile::typeText)==0){
AfxMessageBox("error");
return;
}
file.Read(&m,sizeof(int));
file.Read(&n,sizeof(int));
str.Format("%d",m);
MessageBox(str);
}
我导入的文件里面是内容应该是 50,200
怎么程序运行后,显示的是839528501的?