Subsequence of string using recursion

I am having problem understanding why I am getting the output and
am I making string null when I say "o[j] =’\0’ "
please explain what is happening and what is needed to be improved

hi… so in character arrays u always have to end with output[j] = ‘\0’; its used as a kind of terminator…
rest if u have doubt in code u can refer this --> https://ide.codingblocks.com/s/619519

I know I can do it with character array but I was trying to do it using string
1-can I do it with string
2- am I clearing the whole string when I say " o[j] =’\0’ "

hi… if u are trying to do it with string then no need for this " o[j] =’\0’ "… simply print the resultant string
if u don’t want to use character arrays and use strings u can do it like this https://ide.codingblocks.com/s/233415

I think there is a mistake you sent me sorting Algo.

oh… so sry… refer this --> https://ide.codingblocks.com/s/619519

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.