How to work with copy and istream_iterator?

1
2
3
std::copy (std::istream_iterator<string>(cin),         // beginning of source
        std::istream_iterator<string>(),            // end of source
        std::ostream_iterator<string>(cout,"\n"));  // destination 

how could I quit from it?

besides, if I want to copy partial data from std::ifstream
what should I do with the copy algorithm?
following code would copy all of the data into the container buffer
but I only need partial of it
 
std::copy(std::istream_iterator<unsigned char>(inFile), std::istream_iterator<unsigned char>(), buffer.begin());


Thanks a lot
Last edited on
Topic archived. No new replies allowed.