I'm having problems with istream_iterator reading a file because it ignores blank lines, but I need that those blank lines are included as "".
How should I modify the program below to get the 5 lines in my vector?
#include <sstream>
#include <string>
#include <iostream>
#include <vector>
#include <iterator>
using namespace std;
int main(int argc, const char *argv[])
{
string test = "There\nare\n\nfive\nstrings";
stringstream stream(test);
vector<string> v;
copy(istream_iterator<string>(stream),istream_iterator<string>(),back_inserter(v));
cout << v.size() << endl;
return 0;
}