Indeed, it does alter the source string.
And it keeps information in static (local) variables.
Type: Posts; User: qny
Indeed, it does alter the source string.
And it keeps information in static (local) variables.
Write your own version of strtok().
Then you'll understand what you are doing wrong.
after the initial strtok() with a non-NULL 1st parameter you have to call strtok() with a NULL for the 1st...
Hint: there's a function in the C Standard library named strstr() (prototype in <string.h>) which may be of help.