memcpy
void *memcpy(void *dest, const void *src, size_t n)
/*源码并非单字节进行拷贝,会利用更高效的算法*/
void *memcpy(void *dest, const void *src, size_t count)
{
char *d;
const char *s;
if (dest >= (src+count)) || (dest <= src)) {
d = dest;
s = src;
while (count--) {
*d++ = *s++;
}
} else { /* overlap */
d = (char *)(dest + count - 1); /* offset of pointer is from 0 */
s = (char *)(src + count -1);
while (count --) {
*d-- = *s--;
}
}
return dest;
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。