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++) {
If you initialize the array with malloc, use calloc instead; it will zero your array for free. (Same perf obviously as memset, just less code for you.)
malloc
calloc