LearnFrenzy
Sign in Take a free test

C Library Functions · Library Functions MCQ · Question 7

Which function copies overlapping memory safely? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

Source and destination overlap. Which function copies the bytes correctly?

  • A memcpy
  • B memmove Correct
  • C strcpy
  • D memset
Correct Answer: Option B

memmove works as if copying through a temporary buffer. memcpy and strcpy with overlapping regions are undefined behaviour.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links