counting tokens

hi, i'm just beginning to learn about the string tokenizer (strtok). is there a way that i can count the tokens so that i may compare tokens?

eg. "this is a string"
this != string
is != a
maybe you can store the tokens in strings and then compare the strings.
how should i go about storing the tokens in strings?

char *pstr
pstr = strtok (str, " ,.!?");
while (pstr != NULL)
pstr = strtok (NULL, " ,.!?");


this is the part of my code that uses strtok, and since i use a pointer to create the token, how should i continue?
you can make an array of strings to store them in.
Topic archived. No new replies allowed.