← Quiz: String Handling in C: all 15 questions
Quiz: String Handling in C · Question 10 of 15
In the copy loop while ((d++ = s++) != '\0');, when does the loop stop?
In the copy loop while ((*d++ = *s++) != '\0');, when does the loop stop?
- A.Before copying the '\0'
- B.Right after copying the '\0'
- C.After a fixed 100 characters
- D.It never stops
Answer & explanation
Correct answer: Right after copying the '\0'
The assignment copies the character first, then the test sees it was '\0' and stops — so the copy is properly ended.
Can you get the rest right without peeking?
Take the timed Quiz: String Handling in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →