If you have a function that requires separate items, then strtok might not be the way to go. The strtok is used to locate substrings in a string, and its most common use is to parse a string into tokens, much as a compiler parses lines of code.
Let's take a look at the following example.
char str[20] = "recipName=Fork";
char *one = NULL;
char *two = NULL;
The first parameter is the string that is being parsed; the second is a set of delimiters that will be used to parse the first string. Strtok first skips over all leading delimiter characters. If all the characters in the string are delimiters then it terminates and returns a null pointer. However, when it finds a non-delimiter character, it changes its search and skips over all characters that are not in the set; that is, strtok will search until it finds a delimiter. When a delimiter is found, it is changed to a null character ('\0'), marking the end of the token, and returns a pointer to the new token string.
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+----+
str -> | r | e | c | i | p | N | a | m | e | = | F | o | r | k | \0 |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+----+
Calling strtok like so
one = strtok( str, "=" );
causes the following ( the "=" is now a null character )
+---+---+---+---+---+---+---+---+---+----+---+---+---+---+----+
str -> | r | e | c | i | p | N | a | m | e | \0 | F | o | r | k | \0 |
+---+---+---+---+---+---+---+---+---+----+---+---+---+---+----+
^
|
one -----+ (first token)
Calling strtok one more time
two = strtok( NULL, "=" );
causes the following
+---+---+---+---+---+---+---+---+---+----+---+---+---+---+----+
str -> | r | e | c | i | p | N | a | m | e | \0 | F | o | r | k | \0 |
+---+---+---+---+---+---+---+---+---+----+---+---+---+---+----+
^ ^
| |
one -----+ (first token) two -----+ (second token)
Everything up to this point is dandy. Nevertheless, if you were to use the strlen function you will run into trouble. In addition, if you were to modify the values of "one" and "two", you will most likely override their data.
You can avoid these issues by reading character by character instead.
I hope this helps. :)