The problem is that you aren't breaking it very well - look at your code.
You declare temp and an array of 100 "pointer-to-char" values, and you use
strcpy
to copy the whole remaining line into it:
strcpy(temp[posTok],&input[pos]);
But...you never assign any values to the pointers, so they are all a bit random.
And you never terminate the "tokens" either.
What you need to do it set up temp, but then use malloc to allocate space for each token as you go.
What I would do is:
1) Create an array of token pointers.
2) Use malloc to allocate a "token string space", and set the first char to '\0'. Set it into the next free token array slot.
3) Loop thorugh each character in the input string
3.1) If it's a space copy a '\0' to the token, and allocate a new token space as in (2).
3.2) If it isn't, copy the character to the token.
4) Don't forget to use
free
to release the memory you allocated!
Make sense?