(ANSI Standard)
#include <string.h> ptr = memmove( s1, s2, N );
"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".
"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.
Copyright © 1996, Thinkage Ltd.