“Overlapping memory” does not occur by itself. You can provide a memmove function with areas of memory that overlap. Take two pointers into the same array, and you can easily get overlapping memory areas.
Of course, you can also easily create overlapping objects through joins.
It is not clear what you mean by the second part of the question ("how can this function copy the memory block correctly"). Where do you see the problem here?
AnT
source share