this is the external functions:
i wrote the over write function so it writes the next current function to the previous place.
if "baac\0"=> "bac\0"
am i correct?
how to write the main remove_duplicates function??
Code:
#include <stdio.h>
void overwrite(char string[], int index);
int has_duplicate(char string[], int index, char ch);
int main()
{
return 0;
}
int has_duplicate(char string[], int index, char ch)
{
int count=-1;
int check;
if (string[index]=='\0')
{
if (count<0)
{
return 0;
}
else
{
return 1;
}
}
if (ch==string[index])
{
count++;
}
check=has_duplicate(string,index+1,ch);
}//end func
void overwrite(char string[], int index)
{
string[index-1]=string[index];
if( string[index]!='\0')
{
overwrite(string,index+1);
}
if ( string[index]=='\0')
{
string[index-1]=string[index];
}
}