memcpy
The memcpy function copies count bytes of src to dest. If the source and destination overlap, this function does not ensure that the original source bytes in the overlapping region are copied before being overwritten. Use memmove to handle overlapping regions.
memmove:
The memmove function copies count bytes of characters from src to dest. If some regions of the source area and the destination overlap, memmove ensures that the original source bytes in the overlapping region are copied before being overwritten.
重复了 高地址到低地址
没有重复 低地址到高地址
还有一点注意 const void* src ;指向的src不一定是const。不是const的话可以通过别的方式修改其值,如果想通过src修改的话会报错。memmove中用dst的指针对重复区域(也是src一部分)进行修改体现出来。
还有注意一下判断重复的条件判定语句。