memmove doesn't really move memory isn't that right? It just copies memory from one region to other and allows those two regions to overlap. I'm asking this question because I just want to know why is this fnc called in very misleading manner.
For I understand that when something is moved from one place to the other, the "thingy" is after this operation in the other place and not in the first. And with memmove it doesn't work that way. Am I right?
You are right, it copies it. However, there is a difference between memmove
and memcpy
, because memmove
can treat correctly the case when the buffers overlap, so it is recomended in these cases.
However, because of additional checks that memmove
performs, when the buffers are small and surely does not overlap, memcpy
is better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With