to cyberson: the memset and the loop are very closely like solutions. The actually difference, is that memset
usually is optimized with assembly, and/or loop unrolling techniques, but a simplistic, not ansi-correct, not bad-arg passing proof, implementation would be:
void memset(void *x, int c, int n) {
char *z = x;
while (n--) *z++ = c;
}
the idea to get is: to work with a multidimensional array, just cast the base pointer into a char * pointer, and run through the char * pointer for the total length of the multidimensional array.
cya
--
pkiller