I want to repeatedly zero a large 2d array in C. This is what I do at the moment:
// Array of size n * m, where n may not equal m for(j = 0; j < n; j++) {
memset(array, 0, sizeof(array[0][0]) * m * n);
Where m and n are the width and height of the two-dimensional array (in your example, you have a square two-dimensional array, so m == n).
m
n
m == n