문제

Is there any important difference between the memcpy and the memmove functions? When should I use memcpy and when should I use memmove?

도움이 되었습니까?

해결책

You should use memmove when there's a chance that the source and destination buffers overlap - it is specified to work in that case, whereas memcpy isn't.

In theory memcpy can be faster, if only because it doesn't check for overlapping memory buffers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top