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

Code Example 1

vector<int> a;
vector<int> b;
// Appending the integers of b to the end of a 
a.insert(a.end(), b.begin(), b.end());

Code Example 2

//vector.push_back is the function. For example, if we want to add
//3 to a vector, it is just vector.push_back(3)
vector <int> vi;
vi.push_back(1); //[1]
vi.push_back(2); //[1,2]

Learn ReactJs, React Native from