按行读取数据

CString contents;
ifstream in("E:\\1234.txt");
string filename;
string line;
int i = 0;
if (in)
{
while (getline (in,line))
{
CString temp;
temp.Format("%s",line.c_str());
cout << temp << endl;
}
}else
{
in.close();
return ;
}
in.close();
return ;

posted @ 2015-12-01 16:42  疯封风  阅读(200)  评论(0编辑  收藏  举报