If you want to see, what the pointer actually points to, then you should dreference it, like so: *token
If you want an position in your string (so 0, 1, 2, 3, str.size()-1), try something similar to this:
1 2 3
char *front = &str[0]; // points to first char in string
char *third = &str[2]; // points to third char in string
int pos = third - front;
I would expect to get pos result either 0 or 7 or 8, am not sure. This is first call of strtok. In the case of second call token = strtok(NULL, s); how to get current position in the string str? The values which I want to work with are begin of the word and end of the word.
Also I got *warning:
initialization makes integer from pointer without a cast [enabled by default]|
Do you know, that is is C, not C++?
Also, you are not doing what I did in my example. len is not a pointer, but size_t containing the length of a string without the terminating null byte. So, what do you expect the value to be, which is produced by subtracting a memory address cast to int from an unsigned integer? I sure have no clue. Why don't you just tell us, what you are trying to achieve. Nobody wants to guess what your code is supposed to do.
Here is a little extended code, I hope you can use it to achieve what you want: