copy using istream_iterator
What would be end of source in this case when getting a string input from console?
int main()
{
std::vector<std::string> str;
copy (istream_iterator<std::string>(std::cin), istream_iterator<std::string>(), std::back_inserter(开发者_高级运维str));
}
Terminal input or EOF . Ctrl+D in Unix. Ctrl+Z in Windows.
精彩评论