for the code, why error, osteam_iterator is a template class ,why no matching constructor for initalization of \'ostream_iterator\', please give a help , thank you. define o
ostream_iterator constructor takes const CharT* delim as second parameter:
ostream_iterator(ostream_type& stream, const CharT* delim) (1)
ostream_iterator(ostream_type& stream) (2)
To make your code work, you need to pass in a string:
std::copy(sentence1.begin(), sentence1.end(), std::ostream_iterator(cout, "1"));
// ^^^^