String Remove Duplicates Error

#include
#include
using namespace std;

void duplicate(char *a)
{
//Base case
if(a[0] == β€˜\0’)
{
return;
}

if(a[0] == a[1])
{
	int i = 0;  
    while (a[i] != '\0') { 
        a[i] = a[i + 1]; 
        i++; 
	}

duplicate(a);

}

duplicate(a+1);

}

int main() {
char a[1000];
cin>>a;

duplicate(a);

cout<<a;

return 0;

}

@abhishekchoudhary I did not understand how you were trying to make recursive calls and how duplicate(a+1) should work. I changed your code a little and replaced it with 4 lines code that doesn’t involve recursion.
Please see https://ide.codingblocks.com/s/196907

You see, I want to do it by recursion, and not just print the elements but also make the changes in the original array.

Okay this is a recursive code that makes changes in the original array ,please see https://ide.codingblocks.com/s/196933