I tried following functionality? but couldn't understand.
#include <stdio.h>
#include <string.h>
int main()
{
char str[] = "Geeks-for-Geeks";
char* token = strtok(str, "-");
while (token != NULL) {
printf("%s\n", token);
token = strtok(NULL, "-");
}
return 0;
}
In above code, most importantly I am not getting the part: token = strtok(NULL, "-"); Please explain complete working and code.