initialize array to all zeros c++ code example
Example 1: c++ initialize array with all zeros
int myArray[10] = { 0 }; // all elements 0
Example 2: initialize vector to all zeros c++
// my linkedin : https://www.linkedin.com/in/vaalarivan-prasanna-3a07bb203/
// 1-D case
vector<int> vec(desiredVectorSize, 0);
// 2-D case
vector<vector<int>> vec(desiredNoOfRows, vector<int>(desiredNoOfColumns, 0));