Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Re: memcpy and memmove (http://www.velocityreviews.com/forums/t959333-re-memcpy-and-memmove.html)

Noob 04-03-2013 06:54 AM

Re: memcpy and memmove
 
time wrote:

> What is the the difference between memcpy and memmove please?


Given unsigned char buf[] = {1,2,3,4,5,6,7,8,9};

memmove(buf+1, buf, 8); is well-defined
memcpy(buf+1, buf, 8); has undefined behavior.

See this bug report for a real-life example:
https://bugzilla.redhat.com/show_bug.cgi?id=638477



All times are GMT. The time now is 07:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.