return 2d array c++ code example
Example 1: filling 2d array with 0 c++
int a[x][y];
std::fill(a[0], a[0] + x * y, 0);
Example 2: how to print a 2d array in c++
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
cout << arr[i][j] << " ";
}
// Newline for new row
cout << endl;
}