Check out example codes for "how to insert elements in a vector". It will help you in understanding the concepts better.

Code Example 1

#include<bits/stdc++.h>
using namespace std;

int main()
{
    vector<int> vec = {20, 30, 50, 60};
    vec.insert(vec.begin()+2, 40);
    for(auto x:vec)
    {
        cout << x << " ";
    }

    return 0;
}

Learn ReactJs, React Native from akashmittal.com