1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stddef.h> #include <string.h> void * memset(void *s, int c, size_t n) { char *xs = s; while (n--) *xs++ = c; return s; }