memmove, _fmemmove

copy a number of characters from one buffer to another

Synopsis:

#include <string.h>
void *memmove( void *dst,
               const void *src,
               size_t length );
void __far *_fmemmove( void __far *dst,
                       const void __far *src,
                       size_t length );

Description:

The memmove() and _fmemmove() functions copy length characters from the buffer pointed to by src to the buffer pointed to by dst. Copying of overlapping objects will take place properly. See the memcpy() or _fmemcpy() functions to copy objects that do not overlap.

The _fmemmove() function is a data-model-independent form of the memmove() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.

Returns:

a pointer to the destination buffer (that is, the value of dst)

See also:

memcpy(), memset()

Examples:

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

void main()
  {
    char buffer[80];

    strcpy( buffer, "World");
    memmove( buffer+1, buffer, 79 );
    printf ("%s\n", buffer);
  }

produces the output:

WWorld

Classification:

memmove() is ANSI; _fmemmove() is WATCOM.

Systems:

memmove()
All (except DOS/PM)
_fmemmove()
All (except Netware, DOS/PM)