MEMMOVE - copy characters to (possibly overlapping) string.

(ANSI Standard)

Usage:

#include <string.h>
ptr = memmove( s1, s2, N );

Where:

void *s1;
points to an area of memory that is to receive the copied characters. This must be able to hold at least N characters.
const void *s2;
points to the string from which characters will be copied.
size_t N;
gives the number of characters to copy.
void *ptr;
points to the copied string (i.e. "s1").

Description:

"memmove" copies exactly N characters from the string "s2" into the area of memory pointed to by "s1". Unlike the function "strncpy", "memmove" does not check for the terminating '\0' of string "s2"; it simply copies N characters. It does not put a terminating '\0' on the end of string "s1".

Notes:

"memmove" can safely handle the situation where the source string overlaps the destination string (or vice versa). In situations where there is no danger of such an overlap, the "memcpy" function may be preferred. "memcpy" is not as safe, but it may be faster.

See Also:

expl c lib strncpy

expl c lib strcpy

expl c lib memcpy

Copyright © 1996, Thinkage Ltd.