"Tom" <sn***@hotmail.com> wrote in message
news:78**************************@posting.google.c om...
How do you get the whole line and put it in a vector from a txt file,
I would like to first get a line, store it to the first element in a
vector and then keep on doing this until the end of the file is
reached. I would appreciate it if anyone helped me.
#include <fstream>
#include <string>
#include <vector>
using namespace std;
ifstream Input( "somefile.txt" );
string Line;
vector<string> Txt;
while( getline( Input, Line ) )
{
Txt.push_back( Line );
}