While reading about memmove I read that it can handle MEMORY OVERLAPSbut I am unable to get how a memmory overlap can occur between two strings and how can this function still copy the block of memory correctly.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“Memory overlap” does not occur by itself. It is you who can supply the
memmovefunction with memory regions that overlap. Take two pointers into the same array and you can easily end up with overlapping memory regions.Of course, you can also easily create overlapping objects through unions.
It is not clear what you mean by the second part of the question (“how can this function still copy the block of memory correctly”). Where do you see the problem here?