Combining a vector of strings

后端 未结 4 2009
忘掉有多难
忘掉有多难 2020-12-24 14:11

I\'ve been reading Accelerated C++ and I have to say it\'s an interesting book.

In chapter 6, I have to use a function from to concatenate from a v

4条回答
  •  [愿得一人]
    2020-12-24 14:39

    How about std::copy?

    std::ostringstream os;
    std::copy( vec_strings.begin(), vec_string.end(), ostream_iterator( os ) );
    cout << os.str() << endl;
    

提交回复
热议问题