I'm compile follow code in dev-4.9.8.0 get some problem,but in succeed in vc++ 7.0 . It's the sample code in "The c++ programming language (special edition)" (sec3.8.3):
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
I'm compile follow code in dev-4.9.8.0 get some problem,but in succeed in vc++ 7.0 . It's the sample code in "The c++ programming language (special edition)" (sec3.8.3):
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
string from,to;
cin>> from>>to;
ifstream is(from.c_str());
istream_iterator<string> ii(is);
istream_iterator<string> eos;
vector<string> b(ii,eos);
sort(b.begin(),b.end());
ofstream os(to.c_str());
ostream_iterator<string> oo(os,"\n");
unique_copy(b.begin(),b.end(),oo);
return !is.eof()||!os;
}
The compile message is "14 D:\c++\test.cpp
`istream_iterator' undeclared (first use this function)"
Can anyone explain this. thanks!