#include <iostream>
#include <fstream>
#include <iterator>
#include <list>
#include <errno.h>
#include <string.h>
using namespace std;
int main()
{
ifstream inf("data.dat");
if(inf)
{
istream_iterator<string> it(inf),end;
list<string> ls(it,end);
ostream_iterator<string> ot(cout," ");
copy(ls.begin(),ls.end(),ot);
cout<<endl;
inf.close();
}
else
{
cerr<<strerror(errno)<<endl;
}
return 0;
}c++ stl 读文件
最新推荐文章于 2024-11-15 14:02:42 发布
993

被折叠的 条评论
为什么被折叠?



