我一直在阅读《C++加速学习》,我必须说这是一本有趣的书。
在第6章中,我需要使用来自<algorithm>的函数将vector<string>连接成一个字符串。我可以使用accumulate,但它并没有帮助,因为字符串容器只能push_back字符。
int main () {
using namespace std;
string str = "Hello, world!";
vector<string> vec (10, str);
// Concatenate here?
return 0;
}
如何将字符串连接在一起?