Recursion duplicate character formatting question


My code is giving error for insert().
Please help me to solve this problem

@dsingh200021
You are mixing two seperate things.
Strings as string class objects work different than the char arrays. You are mixing both of them and trying to use string class object as a character pointer. It does not work that way.
You are passing a string class object to a string class pointer and calling the functions using the pointer.
If you wish to use the string class object only , you might want to use the substr function of the string class to generate and use the remaining string since you cannot simply do it with s+1. It would have worked were it a character pointer , but its not.