sir in this function we have used a a while loop while(key>1)
let say key is 4 why it is printing only the 4th key , if we decrease the value of key by 1,then it is value of key becomes 3 then it shold also print the value which is present at key=3.
please clear the doubt
In function extractStringAtKey() , how this fuction is going to giev the output at the given key
hello @Abhishmu5
while(key>1)
{something }
will run for exactly key-1 times .
and in each iteration we are assigning i+1 th string in s .
so after k-1 iteration we will assign k-1+1 th (kth) string to s.
which is why it is only printing kth string.
please rewatch the strtok,video.
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.