how to initialize an array in to zero in a function in c++ code example Example: c++ initialize array with all zeros int myArray[10] = { 0 }; // all elements 0