Recursion duplicate character string

https://ide.codingblocks.com/s/197321 theirs an error in parsig the string to the function please help with that

i have modified the code now it is giving e only for hello

Hey @Learning_bunny
first of all, in line no 24 of your code, you need to write
abc+=str[0];
instead of
abc[0]=str[0];

also, in your dupstr function you need to pass string abc by referrence so that the changed value remains between the subsequent calls (because you’re changing it’s value in every call). Try doing these changes

i have tried doing it lke abc+=str[0] but thats not working then i have changed it to abc[0]=str[0]

and when i passed the string abc with reference then it is showing error in return abc; in line no 7

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.