memmove

From RAD Studio
Jump to: navigation, search

Go Up to mem.h Index


Header File

mem.h, string.h

Category

Memory and String Manipulation Routines

Prototype

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

Description

Copies a block of n bytes.

memmove copies a block of n bytes from src to dest. Even when the source and destination blocks overlap, bytes in the overlapping locations are copied correctly.

Return Value

memmove returns dest.

Example

#include <string.h>
#include <stdio.h>
int main(void)
{
  char *dest = "abcdefghijklmnopqrstuvwxyz0123456789";
  char *src = "******************************";
  printf("destination prior to memmove: %s\n", dest);
  memmove(dest, src, 26);
  printf("destination after memmove:    %s\n", dest);
  return 0;
}

Portability

POSIX Win32 ANSI C ANSI C++

memmove

+

+

+

+

_fmemmove