Check out example codes for "allocate memory c++". It will help you in understanding the concepts better.

Code Example 1

Example:
        int *p = new int[10]

Code Example 2

int length = 69;
int * numbers = new int[length];
delete[] numbers;

Learn ReactJs, React Native from akashmittal.com