Check out example codes for "how to create an unknown amount of objects in c++". It will help you in understanding the concepts better.

Code Example 1

Box **array = new Box*[n];
for(int i = 0; i < n; i += 1) {
    array[i] = new Box();
}

Learn ReactJs, React Native from akashmittal.com