its a c library function which is used to tokenize a given string based on the token character provided.
its prototype is char *strtok(char *str, const char*tok).
char a = "This is-queryhome.com-QA-website";
char *tok = strtok(a, '-');
tok = strtok(NULL, '-');
Basically strtok() function maintains a local static reference, which points to the next token in the string, when we pass a null to strtok() its uses that internal reference. This is the reason strtok is neither re-entrant nor thread safe. as you pass the new reference to strtok() that old internal reference gets overwrite.