how to initialize whole array to 0 in 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: initialize whole array to 0 c++
int nScores[100] = {0};
Example 3: c++ initialise array
int nCount[] = {1, 2, 3, 4, 5};
Example 4: c++ initialize array
int arr[3] = {1, 5, 4};