Hallo!
How can I reset strtoc()?
After I have caled it twice "strtok(string, " ") ",
it works not fine "strtok(NULL, " ")".
Is there a solution?
Code:#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { char string[] = "aa bbb cc aa dd gg"; char *ptr = NULL; ptr = strtok(string, " "); /* do something */ ptr = strtok(string, " "); while (ptr) { puts(ptr); ptr = strtok(NULL, " "); } return 0; }