C memcpy function

« Previous

Synopsis:

Example

#include <stdio.h>
void* memcpy(void* s, const void* ct, int n);

Description:

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.

Return Value

The memcpy function returns dest.

Example

Example

#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 :

Output

dst = "Copy this string to dst1"


« Previous
Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!