内存拷贝

liyuan02 2007-02-12 08:27:58
请问 memcpy 和 memmove 有什么区别 ? 我觉得 memcpy 是不是 多余的?以后用memmove 就可以了。 是这样的吗 ? 谢谢!
...全文
414 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
bigpool 2007-02-14
  • 打赏
  • 举报
回复
memcpy效率高,但是不考虑拷贝区域重叠的情况
memmove效率稍差,因为要考虑拷贝区域重叠的情况
不想低调 2007-02-14
  • 打赏
  • 举报
回复
不是这样的。。。
jf
bgqy2000 2007-02-14
  • 打赏
  • 举报
回复
memcpy 不检查区域重叠,相对而言效率可能更好。
memmove 对于区域重叠的情况来说是安全的。
intuition444 2007-02-13
  • 打赏
  • 举报
回复
The memcpy function copies count bytes of src to dest. If the source and destination overlap, this function does not ensure that the original source bytes in the overlapping region are copied before being overwritten. Use memmove to handle overlapping regions.

The memmove function copies count bytes of characters from src to dest. If some regions of the source area and the destination overlap, memmove ensures that the original source bytes in the overlapping region are copied before being overwritten.
Wolf0403 2007-02-12
  • 打赏
  • 举报
回复
memcpy 不检查区域重叠,相对而言效率可能更好。
memmove 对于区域重叠的情况来说是安全的。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧