|
| memcpy| Summary | | | Description | The memcpy function copies len bytes from src to dest. If these memory buffers overlap, the memcpy function cannot guarantee that bytes in src are copied to dest before being overwritten. If these buffers do overlap, use the memmove function. | | Return Value | The memcpy function returns dest. | | See Also | memccpy, memchr, memcmp, memmove, memset | | Example |
#include <string.h>
#include <stdio.h> /* for printf */
void tst_memcpy (void) {
char src1 [100] = "Copy this string to dst1";
char dst1 [100];
char *p;
p = memcpy (dst1, src1, sizeof (dst1));
printf ("dst = \"%s\"\n", p);
}
|
|
|