how to fill a 2d array with a single value in c++ code example Example: filling 2d array with 0 c++ int a[x][y]; std::fill(a[0], a[0] + x * y, 0);