Check out example codes for "c++ create vector of size". It will help you in understanding the concepts better.

Code Example 1

// create a vector with 20 integer elements
std::vector<int> arr(20);

for(int x = 0; x < 20; ++x)
   arr[x] = x;

Learn ReactJs, React Native from akashmittal.com