String /sentence entered not being displayed

I am entering the string/sentence --> hello world $
and when i am displaying it such that hello world should be printed , only first character h is being displayed.

I am taking $ as delimiter.

hi @ujj1804_1156aee80205d0bf
there was a small mistake… u were writting

a[i]='\0';
return; 

inside the while loop… just move it out of while loop, ur code will work fine…

corrected code --> https://ide.codingblocks.com/s/643398

hi @ujj1804_1156aee80205d0bf
i hope its clear now???

1 Like

Yes sir it’s clear now. Thanks

1 Like

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.