Strtok function in a program

unable to use strtok() for two separate strings in my program
After printing ftokens of first string,its not printing tokens of second string.is there any way to reset strtok().Please solve this problem

@KetanPandey hi ,take ftokens of first string separate char pointer and another string in different char pointer ,you will get correct ans,like this:
#include <stdio.h>

#include <string.h>

int main()

{

char str[] = "fofof-f-f" ;

// Returns first token

char *token = strtok (str, "-" );

// Keep printing tokens while one of the

// delimiters present in str[].

while (token != NULL)

{

printf ( "%s\n" , token);

token = strtok (NULL, "-" );

}

return 0;

}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.