why are we taking char s ? and what does this *ptr gives and ptr gives, please clear my this topic , i am too much confused …
Tokenization using strtok()
Hey array name is a pointer itself which is pointing to the first element
So char s[] == char *s
Now we used char s[] because strtok accepts a character array only
char *ptr=strtok(s," “) here ptr will collect the array returned by strtok function
ptr =strtok(s,” ") Here again ptr will collect the output array,
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.