1 2 3 4 5 6 7 8 9 10 11 12
#include <sys/types.h> void* memcpy(void* dst, const void* src, size_t count) { register char *d=dst; register const char *s=src; ++count; /* this actually produces better code than using count-- */ while (--count) { *d = *s; ++d; ++s; } return dst; }