Is this the right ans


Is it correct way or is there any better way?

@goyalvivek this is fine

can i send a function (s+1, n-1, key) where s is a string?

@goyalvivek doing s+1 would work for a character array since it can also act like a pointer. But here you are using string datatype not character array, so you cannot do s+1

It means i have to initialize function as(char *ch, int n, int key) right?

@goyalvivek yes and in string declaration as well. Basically anywhere you have used string you will need to replace it with char * or char[].

my aim is string manipulation in recursion, can u provide me an example where i can use (s+1, n-1, key)

@goyalvivek i dont understand your question, please tell how do you want to manipulate the string. You can manipulate string with string library functions as well, you dont necessarily need to use a character array. The recursion call depends on your use case so its better if you can give me an idea of the kind of questions you are looking to solve

Strings-Remove Duplicates is the question in challenge section and my approach is https://ide.codingblocks.com/s/588572

@goyalvivek you can raise a doubt for that challenge, only the question you raise doubt on is visible to us.

ok, i’ll raise a doubt in that question, thanks for ur help in this one

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.