1 2 3 4 5 6 7 8
#include <stddef.h> void *memset(void *dest, char val, size_t count) { char *temp = (char *) dest; for (; count != 0; count--) *temp++ = val; return dest; }