I dont understand that what happens internally when null is passed in strlok.
Strtok doubt in previous topic
hello @govilayush
internal inplementation of strtok is already covered in ur course that too from scratch.
pls check ur string playlist
internal implementations were not discussed. And there is no string playlist.
This is how strtok works:
On a first call, the function expects a C string as argument for str , whose first character is used as the starting location to scan for tokens. In subsequent calls, the function expects a null pointer and uses the position right after the end of the last token as the new starting location for scanning.
you pass NULL in subsequent calls because the strtok function retains its previous iterator location, also if you still pass str(or char array) then it will start again!
for internal implementation you may see this code:
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.