voidCChoosePointDlg::read_file()
{
CStdioFile file;
CString strline;
vector<CString> strtemp;
if(!file.Open("C:\\Users\\FeiTao\\Desktop\\test.txt",CFile::modeRead))return;
while(file.ReadString(strline)){
if(strline != _T(""))
{
char *str = strline.GetBufferSetLength(strline.GetLength());
char *p;
for(p=strtok(str,"\t");p!=NULL;p=strtok(NULL,"\t"))
{
strtemp.push_back(p);
}
m_data.push_back(strtemp);
strtemp.clear();
}
}
}
C++-按行读取数据,并按固定格式分开
最新推荐文章于 2024-05-16 16:18:47 发布