What is wrong with this code?

#include<bits/stdc++.h>
#include
using namespace std;
void print(string out,string s,int n,int s_index,int out_index)
{
if(s_index==n)
{
cout<<out<<endl;
return ;
}
if(s[s_index]==s[s_index+1])
{
out[out_index]=s[s_index];
print(out,s,n,s_index+2,out_index+1);
}
else
{
out[out_index]=s[s_index];
print(out,s,n,s_index+1,out_index+1);
}
}
int main()
{
string s;
cin>>s;
int n=s.length();
string out;
for(int i=0;i<n;i++)
out[i]= ’ ';
print(out,s,n,0,0);
}

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

Check now.