Prateek bhaiya said that it stores as a static array, the state of the string, but what if we have more than a single string to
tokenize?
The code which i tried is
Prateek bhaiya said that it stores as a static array, the state of the string, but what if we have more than a single string to
tokenize?
The code which i tried is
it would not make a difference if u have multiple tokens
a static array is make in that case too
Did u face error in the coding part?
If you see the code that i wrote, in that I am not getting both the string as tokens, instead i am getting a mixed up output. Please look into it once. Thanks
Bro I am not understanding the logic
I have asked someone about it
I`ll let u know when i get to know
You can’t strtok() two separate strings at the same time. It records internal state (which you access by passing NULL to extract further tokens in the current string).
Use strtok_r if you want to tokenise multiple strings at the same time.
read more about it on :
https://cboard.cprogramming.com/c-programming/132953-strtok-twice-means-problems.html
Okay Thank you so much!
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.