initialize array dynamically c++ code example
Example: 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] <<" "; }
int *arrayName = new int[10]{0};
//Print array elements
for(int i=0; i<10; i++ { cout<<arrayName[i] <<" "; }