At the end of the string Today is a rainy day.
How token “day” will be copied in the output array?
As the code is like:
if(input[i]=delim)
{
output = input;
}
But here the delim is ’ ’ and is not NULL.
As there is no ’ ’ after the token day.
At the end of the string Today is a rainy day.
How token “day” will be copied in the output array?
As the code is like:
if(input[i]=delim)
{
output = input;
}
But here the delim is ’ ’ and is not NULL.
As there is no ’ ’ after the token day.
No if you see the code then for loop will come to end as the input will come to null at last and then it will come out of the loop and then null will be appended in output and then input will be initialised with null and then day will get printed.
if you have any doubt you can ask here:
Happy Learning!!
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.