strtok problem in calling
- by Moony
I have a function using strtok like this
void f1(char *name)
{
...
char *tmp;
tmp = strtok(names, " ,");
while(tmp)
{
...
tmp = strtok(NULL, " ,");
}
...
}
And i have a call f1("abc,def");
Problem is that in first call f1 gets abc,def
and in 2nd call gets just abc
I am confused.. Why is this so?