Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
memcpy 和 memmove 函数之间有什么重要区别吗?什么时候应该使用 memcpy,什么时候应该使用 memmove?
当源缓冲区和目标缓冲区有可能重叠时,您应该使用memmove它 - 它被指定在这种情况下工作,而memcpy不是。
memmove
memcpy
理论上memcpy可以更快,如果只是因为它不检查重叠的内存缓冲区。