|
From: bhadram r. <bha...@ya...> - 2005-09-11 13:29:27
|
Dear friends,
I'd a problem. Please see the code below.
int main()
{
ifstream infile("exclusion_set");
istream_iterator<string> input(infile),eos;
vector<string> vec;
copy(input,eos,inserter(vec,vec.begin()));
sort(vec.begin(),vec.end(),greater<string>());
ostream_iterator<string> output(cout,"\n");
unique_copy(vec.begin(),vec.end(),output);
return 0;
}
if "exclusion_set" file cotents are like this:
the and but that then are been
can can't cannot could did for
had have him his her its into
were which when with would
the output will be each word like
the
and
etc.......
But if i want to read each line in the specified vector instead of each word. How shall i do.Which parameter that i should set so that each line is read in vector element.Please help.
Thanking you,
yours sincerely,
bhadram
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com |