Well, it seems we're at a misunderstanding as to what token means. According to what it's being described as in this thread, the following would be my reply:
You cannot make a token be more than one character. A token is a single character that strtok searches for for its "stop point". Thus, you cannot make the token be more than one character. Just as I mentioned. Example:
Code:
char words[] "blah blah bla blaba bla";
char token[] = "ab";
char *ptr;
ptr = strstr( words, token ); /* Will find the multi-character token "ab". */
ptr = strtok( words, token ); /* Won't. Will stop at the first character in the string. */
However, if we use token as described by the strtok man page, then the reply would have to be different. They describe it as:
A `token' is a nonempty string of characters not occurring
in the string delim, followed by \0 or by a character
occurring in delim.
If we use that definition of token, then it will almost always be multiple characters. In fact, it will be multiple characters if there is ever any occurance of a non-delims character at all. Because it will have a null stuck on the end, making it multiple characters.
So... it depends what the OP meant by token I guess.
Quzah.