c++ 流迭代器

#include "stdafx.h"
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string from,to;
cin>>from>>to;
ifstream is(from.c_str());
istream_iterator ii (is);
istream_iterator eos;

vector b(ii,eos);// 有问题
sort(b.begin(),b.end());

ofstream os(to.c_str());
ostream_iterator oo(os,"\n");

unique_copy(b.begin(),b.end(),oo);
return !is.eof() && !os;
}



/*istream_iterator in_iter(cin),eof;
	ostream_iteratorout_iter(cout,"\n");
	while(in_iter!=eof)
	{
	  *out_iter =*in_iter;
	  out_iter++;
	 in_iter++;
	}*/


你可能感兴趣的:(c++ 流迭代器)