从这个链接: http ://clc-wiki.net/wiki/memmove
#include <stddef.h> /* for size_t */
void *memmove(void *dest, const void *src, size_t n)
{
unsigned char *pd = dest;
const unsigned char *ps = src;
if (__np_anyptrlt(ps, pd))
for (pd += n, ps += n; n--;)
*--pd = *--ps;
else
while(n--)
*pd++ = *ps++;
return dest;
}
使用是__np_anyptrlt
多余的吗?为什么不直接使用if (ps < pd)
?