C programming string.h function - char *strtok(char *str, const char *delim)

https://‮.www‬theitroad.com

The strtok function is used to tokenize a string into smaller parts, based on a set of delimiters. It takes two arguments:

char *strtok(char *str, const char *delim);

The first argument, str, is the string to be tokenized. On the first call to strtok, this should be the string to be tokenized. On subsequent calls to strtok, str should be set to NULL in order to continue tokenizing the original string.

The second argument, delim, is a string containing the set of delimiters to use when tokenizing the input string.

The strtok function returns a pointer to the next token found in the input string, or NULL if no more tokens are found. The original input string is modified by strtok as it advances through the string, replacing the delimiter characters with null terminators.