Re: memcpy and memmove

Discussion in 'C Programming' started by Noob, Apr 3, 2013.

  1. Noob

    Noob Guest

    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
    Noob, Apr 3, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    11,354
    Gianni Mariani
    Feb 14, 2005
  2. Mike Wahler

    resolved: difference between memcpy and memmove

    Mike Wahler, Sep 27, 2003, in forum: C Programming
    Replies:
    21
    Views:
    1,411
    Jirka Klaue
    Sep 30, 2003
  3. novice

    diff memcpy and memmove

    novice, Mar 10, 2006, in forum: C Programming
    Replies:
    8
    Views:
    727
    Default User
    Mar 10, 2006
  4. somenath

    Question regarding memcpy and memmove function

    somenath, Sep 2, 2007, in forum: C Programming
    Replies:
    16
    Views:
    767
    somenath
    Sep 4, 2007
  5. Malcolm McLean

    Re: memcpy and memmove

    Malcolm McLean, Apr 3, 2013, in forum: C Programming
    Replies:
    0
    Views:
    161
    Malcolm McLean
    Apr 3, 2013
Loading...

Share This Page