Check out example codes for "initialize dynamic array c++ to 0". It will help you in understanding the concepts better.

Code Example 1

int *arrayName = new int[10]{0}; 
//Print array elements
for(int i=0; i<10; i++ { cout<<arrayName[i] <<" "; }

Learn ReactJs, React Native from akashmittal.com