为什么编译过不去?
这段是Bjarne Stroustrup 的<<C++程序设计语言>>中的一段程序,
头文件都include 了
int main(int argc, char* argv[])
{
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;
}
vector<string> b(ii,eos);这句话为什么报错,好象是类型不对?如何转换?
原文是int main()我用了控制台框架,有区别吗?
谢谢大家