Jim Langston wrote:
> [..]
> // Now we read each word out one by one til there's no more and
> stuff them into our vector
> std::string word;
> while ( Parse >> word )
> Words.push_back( word );
Replace the three lines above with this:
std::copy(std::istream_iterator<std::string>(Parse ),
std::istream_iterator<std::string>(),
std::back_inserter(Words));
>
> // At this point each word is in the vector.
>
> for ( WordVec::iterator it = Words.begin(); it != Words.end();
> ++it ) std::cout << (*it) << "\n";
Replace the loop with this:
std::copy(Words.begin(), Words.end(),
std:

stream_iterator<std::string>(std::cout, "\n"));
>
> std::string wait;
> std::getline( std::cin, wait );
> }
And you get an even more radical standard-library based program!
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask