Machine-translated by Google. Questions are authored in English.
Top

Discussion

What does void *memcpy(void *dest, const void *src, size_t n) do?

  • A.copies n characters from src to dest
  • B.copies n character from dest to src
  • C.transform n character from dest to src
  • D.transform n character from src to dest

Answer: A

Correct answer: copies n characters from src to dest

memcpy copies n bytes from src to dest - destination first, as throughout the library. The source is const because it is only read, and the return value is the destination pointer. The two regions must not overlap; memmove is the version that handles overlap correctly.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.