(ANSI Standard)
#include <string.h> ptr = memcpy( s1, s2, N );
"memcpy" copies exactly N characters from the string "s2" into the area of memory pointed to by "s1". Unlike the function "strncpy", "memcpy" 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".
The current implementation of "memcpy" cannot handle the situation where the source string overlaps the destination string. For a copy function that is safe for overlapping strings, see "expl c lib memmove".
For efficiency, some calls to "memcpy" are performed in-line instead of with actual function calls. If you are examining your program with a debugger and put a breakpoint in "memcpy", the breakpoint will not catch the in-line uses of "memcpy".
Copyright © 1996, Thinkage Ltd.