Check out example codes for "c++ allocate dynamic with initial values". It will help you in understanding the concepts better.

Code Example 1

int length = 50;
int *array = new int[length]();
// returns 50 length array of 0

Learn ReactJs, React Native from akashmittal.com