how to initialize dynamic array in c++ by zeros 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] <<" "; }