[Previous]
[Contents]
[Next]

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() function copies 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() function to copy objects that don't 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).

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.

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

memchr(), memcmp(), memcpy(), memicmp(), memset()


[Previous]
[Contents]
[Next]