#include <stdio.h> void* memcpy(void* s, const void* ct, int n);
The memcpy function copies n bytes from ct to s. If these memory buffers overlap, the memcpy function cannot guarantee that bytes in ct are copied to s before being overwritten. If these buffers do overlap, use the memmove function.
The memcpy function returns dest.
#include <stdio.h> int main() { char src [100] = "Copy this string to dst1"; char dst [100]; char *p; p = memcpy (dst, src, sizeof (dst)); printf ("dst = \"%s\"\n", p); }
Output Will Be :
dst = "Copy this string to dst1"
Your Query was successfully sent!