Defined in header
void* memmove( void* dest, const void* src, std::size_t count );
count characters from the object pointed to by
src to the object pointed to by
dest. Both objects are reinterpreted as arrays of unsigned char.
The objects may overlap: copying takes place as if the characters were copied to a temporary character array and then the characters were copied from the array to
If the objects are not
TriviallyCopyable (e.g. scalars, arrays, C-compatible structs), the behavior is undefined unless the program does not depend on the effects of the destructor of the target object (which is not run by memmove) and the lifetime of the target object (which is ended, but not started by memmove) is started by some other means, such as placement-new.
|dest||-||pointer to the memory location to copy to|
|src||-||pointer to the memory location to copy from|
|count||-||number of bytes to copy|
 Return value
Despite being specified "as if" a temporary buffer is used, actual implementations of this function do not incur the overhead or double copying or extra memory. A common approach (glibc and bsd libc) is to copy bytes forwards from the beginning of the buffer if the destination starts before the source, and backwards from the end otherwise, with a fall back to the more efficient std::memcpy when there is no overlap at all.
 See also
| copies one buffer to another |
| copies a certain amount of wide characters between two, possibly overlapping, arrays |
| copies a range of elements to a new location |
| copies a range of elements in backwards order |
| checks if a type is trivially copyable |
C documentation for memmove