1 2 3 4 5 6 7 8 9
#include <string.h> void * memset(void * b, int c, size_t len) { char * destination = (char *)b; while (len--) { *destination++ = (unsigned char)c; } return b; }