Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ memmove(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

memccpy(S)

memcpy(S)


 memmove(S)                     6 January 1993                     memmove(S)


 Name

    memmove - copies characters between objects

 Syntax


    cc  . . .  -lc


    #include <string.h>

    void *memmove(dest, src, count)
    void *dest;
    const void *src;
    size_t count;


 Description

    The memmove function copies count characters from src  to dest.  If some
    regions of src and dest overlap, memmove ensures that the original src
    bytes in the overlapping region are copied before being overwritten.

 Return value

    The value of dest, the destination object.

 Example


       #include <stdio.h>
       #include <string.h>

       char Source[] = ">>>>>>>>>><<<<<<<<<<";
       char Target[] = "Copy the characters in here: "
                       "to see if memmove correctly moves "
                       "in the string";
       char *ToPrint;

       main()
        {
               printf("Target Before: %s\n\n", Target);
               ToPrint = memmove(&Target[32], Source, sizeof(Source));
               printf("Target After:  %s\n", Target);
        }

    Using memmove, string Source is copied into string Target.  sizeof
    returns the size of the string, including the end-of-string character,
    effectively shortening Target.

 See also

    memccpy(S), memcpy(S)

 Standards conformance

    memmove is conformant with:
    ANSI X3.159-1989 Programming Language -- C.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026