Issue with code

Hi, I am running the same code but for the input string ‘cccoding’ the output i am getting is ‘ccccccc’, please help.

#include
#include
using namespace std;
void removeDuplicates(char a[]){
int l = strlen(a);
if(l==1 or l==0){
return;
}
int prev=0;
for(int current=1;current<l;current++){
if(a[current]=a[prev]){
prev++;
a[prev]=a[current];
}
}
a[prev + 1] = ‘\0’;
return;
}

int main() {
char a[1000];
cin.getline(a,1000);
removeDuplicates(a);
cout<<a<<endl;
return 0;
}

hello @bibbudata
pls save ur code at cb ide and share its lnk with me