首先,来了解一下memmove函数的声明类型,Linux c中的定义如下:
#include <string.h> void *memmove(void *dest, const void *src, size_t n);
Description
The memmove() function copies n bytes from memory area src to memory area dest. The memory areas may overlap.
把src所指的内存内容移动到dest指向的内存位置。
Return Value
The memmove() function returns a pointer to dest.
使用时注意的问题是:拷贝从低字节向高字节方向拷贝。