Contact: aviboots(AT)netvision.net.il
40,697 questions
53,048 answers
573 users
#include <iostream> #include <vector> int main() { std::vector<int> v = {10, 20, 30, 40}; // Insert three copies of 86 at position 2 v.insert(v.begin() + 2, 3, 86); for (int x : v) { std::cout << x << " "; } } /* run: 10 20 86 86 86 30 40 */