memmove() function copies a block of memory from a location to another.
This function copies the data first to an intermediate buffer, then from buffer to destination. So, memmove() is slightly slower approach than memcpy().
This function doesn't overlap the source. So, memmove() is safer than memcpy().
|dest||Required||Destination array where the content is to be copied.|
|src||Required||Source of data to be copied.|
|n||Required||Number of bytes to be copied.|
|Address||Returns a pointer to the destination, which is dest array.|
In the following example, the destination string is "cde" and the source string is "abcde". So, the memmove() function will replace "cde" with "abc" and the result is ababc.
In the following example, memcpy() overlaps the source, but memove() doesn't.