+ 3

Somebody pls explain the working of strtok(str, delimiter) function in C???

18th Jul 2020, 3:34 AM
Naresh Chakali
Naresh Chakali - avatar
3 Answers
+ 4
This reference gives details 👇 https://en.cppreference.com/w/c/string/byte/strtok
18th Jul 2020, 3:46 AM
Ipang
+ 4
token = strtok(NULL, " "); explain this line
18th Jul 2020, 3:49 AM
Naresh Chakali
Naresh Chakali - avatar
+ 3
The use of this is to tell `strtok` to try to find the next token, but `strtok` should use the same string that is given in the first call.
18th Jul 2020, 3:54 AM
Ipang