🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It returns empty strings for empty fields like ",,"
  2. B.It does not change the input string
  3. C.It keeps hidden state between calls, so you continue with strtok(NULL, ...)
  4. 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 →