cpp initializing dynamic array to 0 code example
Example 1: initialize whole array to 0 c++
int nScores[100] = {0};
Example 2: 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] <<" "; }