← 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?
- A.It's slow
- B.It doesn't check the destination size, so it can overflow the buffer
- C.It deletes the source
- 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 →