使用流迭代器,初始化1个vector对象失败,求教,知道的快说下,我还等着往下写呢
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
int main()
{
istream_iterator <string> in(cin),eof;
vector <string> st(in,eof);
}
我用的是vc++6.0编译
随便问下我给你们的分是哪来的啊,如果给光了, 我还能提问题吗???
[解决办法]
VC6要这样初始化
vector <string> st;
copy(in,eof,back_inserter(st));