Please explain to me the working of strtok()
function. The manual says it breaks the string into tokens. I am unable to understand from the manual what it actua
The first time you call it, you provide the string to tokenize to strtok
. And then, to get the following tokens, you just give NULL
to that function, as long as it returns a non NULL
pointer.
The strtok
function records the string you first provided when you call it. (Which is really dangerous for multi-thread applications)