Why is the output of the following program 84215045?
84215045
int grid[110]; int main() { memset(grid, 5, 100 * sizeof(int)); printf(\"%d\", grid
memset is about setting bytes, not values. One of the many ways to set array values in C++ is std::fill_n:
memset
std::fill_n
std::fill_n(grid, 100, 5);