Remove duplicates

#include<bits/stdc++.h>
using namespace std;

void st(string str,int i){
str = str+str[i];
if(i == str.length()-1){
// out[j] = ‘\0’;
//cout<<out;
return;
}
if(str[i] == str[i+1]){
st(str,i+2);
}
st(str,i+1);
}

int main(){
string str;
cin>>str;
st(str,0);
cout<<str;
}

why is my code not giving any output

please send link of your code
save it at https://ide.codingblocks.com/
and send the link generated

as you are doing changes on same string so you have to shift the string
if you want to do it like that you have to use another string
reference code if needed

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.