Dulicate Character Formatting

#include
#include
using namespace std;

string dupchar(string sin,string sout,int i)
{

if(sin[i+1]=='\0')
   return sout;
   
else
{
	if(sin[i]==sin[i+1])
	  sout+='*';
	sout+=sin[i+1];
	dupchar(sin,sout,i+1);
}

}

int main()
{
string sin,sout;
cin>>sin;

sout=sin[0];
cout<<dupchar(sin,sout,0);
return 0;

}

compilation error in code block please check the code

Please save your code on ide.codingblocks.com and then share its link.

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.