← Quiz: String Handling in C: all 15 questions
Quiz: String Handling in C · Question 9 of 15
Which statement about strtok is true?
Which statement about strtok is true?
- A.It returns empty strings for empty fields like ",,"
- B.It does not change the input string
- C.It keeps hidden state between calls, so you continue with strtok(NULL, ...)
- D.It can safely split two different strings at the same time
Answer & explanation
Correct answer: It keeps hidden state between calls, so you continue with strtok(NULL, ...)
strtok remembers its position internally; that is also why interleaving two strings breaks it.
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 →