What is the difference between memmove and memcpy?

前端 未结 9 1726
Happy的楠姐
Happy的楠姐 2020-11-28 02:13

What is the difference between memmove and memcpy? Which one do you usually use and how?

9条回答
  •  悲&欢浪女
    2020-11-28 02:36

    memmove can deal with overlapping source and destination regions, while memcpy cannot. Among the two, memcpy is much more efficient. So, better to USE memcpy it if you can.

    Reference: https://www.youtube.com/watch?v=Yr1YnOVG-4g Dr. Jerry Cain, (Stanford Intro Systems Lecture - 7) Time: 36:00

提交回复
热议问题