Hi all,
Can anybody help me to understand the working of strtok function.
I write a small program and it's give some output that i am unable to understand.
The output i got isCode:#include<stdio.h> #include<string.h> int main() { char* temp1; char* temp = _strdup("hi,,ji,ki,ko,f,,s,,"); temp1 = strtok(temp,",,"); while(temp1) { printf("%s\n",temp1); temp1 = strtok(NULL,",,"); } return 1; }
hi
ji
ko
f
s
I am using visual studio 2010.
Thanks