首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

内存拷贝,该如何解决

2012-02-21 
内存拷贝请问memcpy和memmove有什么区别?我觉得memcpy是不是多余的?以后用memmove就可以了。是这样的吗?谢

内存拷贝
请问   memcpy   和   memmove   有什么区别   ?   我觉得   memcpy   是不是   多余的?以后用memmove   就可以了。   是这样的吗   ?   谢谢!

[解决办法]
memcpy 不检查区域重叠,相对而言效率可能更好。
memmove 对于区域重叠的情况来说是安全的。
[解决办法]
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.
[解决办法]
memcpy 不检查区域重叠,相对而言效率可能更好。
memmove 对于区域重叠的情况来说是安全的。
[解决办法]
不是这样的。。。
jf
[解决办法]
memcpy效率高,但是不考虑拷贝区域重叠的情况
memmove效率稍差,因为要考虑拷贝区域重叠的情况

热点排行