Concatenating two std::vectors

后端 未结 25 2286
予麋鹿
予麋鹿 2020-11-22 12:00

How do I concatenate two std::vectors?

相关标签:
25条回答
  • 2020-11-22 12:35
    vector<int> v1 = {1, 2, 3, 4, 5};
    vector<int> v2 = {11, 12, 13, 14, 15};
    copy(v2.begin(), v2.end(), back_inserter(v1));
    
    0 讨论(0)
提交回复
热议问题