initiliaze dynamically array c++ code example
Example 1: initialize dynamic array c++ to 0
int *arrayName = new int[10]{0};
//Print array elements
for(int i=0; i<10; i++ { cout<<arrayName[i] <<" "; }
Example 2: c++ delete dynamically allocated array
int length = 69;
int * numbers = new int[length];
delete[] numbers;