🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Arrays and Strings: all 10 questions

Quiz: C Arrays and Strings · Question 5 of 10

Why is strcpy dangerous?

Why is strcpy dangerous?

  1. A.It's slow
  2. B.It doesn't check the destination size, so it can overflow the buffer
  3. C.It deletes the source
  4. D.It only copies numbers
Answer & explanation

Correct answer: It doesn't check the destination size, so it can overflow the buffer

Writing past the end of an array corrupts memory — a classic security hole.

Can you get the rest right without peeking?

Take the timed Quiz: C Arrays and Strings quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →