Monday, August 20, 2007

memcpy function implementation


//Most simplified copy function.
void *memcpy(void* dest, const void* src, size_t count)
{
char *s = (char *)src;
char *d = (char *)dest;
for(; count; count--)
{
*s++ = *d++; //usage of operator precendence
}
}


Powered by ScribeFire.

2 comments: