Somewhere in my program I get these outputs:
ee
or:
thht
Basically I want to remove the duplicates to obtain e or th. I got this code:
j = 0;
for (i = 1; i < strlen(erros); i++)
{
if (erros[j] != erros[i])
{
erros[j+1] = erros[i];
j++;
}
}
This code gives me e and tht. If in the first case its OK, in the second its not. I believe it is due because I don't have a sorted array.
Is there a way, without sorting the array and using the above code, to obtain the desired output?