/* strtok example */
#include <stdio.h>
#include <string.h>
int main ()
{
char str[] ="- This, a sample string.";
char * pch;
printf ("Splitting string \"%s\" into tokens:\n",str);
pch = strtok (str," ,.-");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ,.-");
}
return 0;
}
Mam taki przykładowy kod, gdzie nie rozumiem jak ta fukcja idzie po kolei i dzieli, nie rozumiem po co dzieli w petli i przed petla mógłby ktoś mi to wytłumaczyć??