You can look at some source code for memmove here, here, here, and here.
What you'll notice is that they don't actually make a temporary array. The man pages are written to help you understand what it is doing logically, not actually. Hence, they say "as though".
What memmove() actually does is copy the bytes from src
to dest
, and it copies forward if dest < src
(which is essentially the same thing as memcpy), and backwards otherwise.
The difference between memcpy
and memmove
is that memcpy
blindly copies forward - which is why dest
and src
should not overlap. But memmove
takes the precaution of ensuring the overlap will not screw up the end result.