Why would you give me bad reputation
"i dont know but here's google" may be appropriate in some cases, but Monkey_King posted a decent question, included formatted code, described the output he wanted, and asked why wasnt it working exactly the way he anticipated.
And the answer is not so easy, because
strtok() is a difficult function for inexperienced programmers to understand from just a basic description.
to post a snarky, unhelpful
RTFM-style answer is totally appropriate for newbs or other lazy sods who just want someone to do their work for them. But Monkey_King, as evidenced by the clarity of his post and the effort he made prior to posting, is obviously not in that group.
there are plenty of unhelpful or inappropriate posts on these forums. But i found your
Post #2 to be
both unhelpful
and inappropriate so i neg-repped it. tux4life, as it turns out, disagreed with me so he pos-repped it.
now measured by net gain, you have come out ahead, gaining even more more rep points than Tom Gunn, the one person to actually post a thoughtful and correct solution.
so be proud. you scored.

and for someone who "doesn't know, but can use google", you did a good job whining for your rep
.