删除重复的字符某处在我的计划,我得到这些输出:c从阵列
ee
或:
thht
基本上我想删除重复获得e
或th
。我得到这个代码:
j = 0;
for (i = 1; i < strlen(erros); i++)
{
if (erros[j] != erros[i])
{
erros[j+1] = erros[i];
j++;
}
}
此代码给我e
和tht
。如果在第一种情况下它可以,在第二种情况下则不行。我相信这是因为我没有排序数组。
有没有一种方法,没有排序数组和使用上面的代码,以获得所需的输出?
可能的重复[在C中删除重复数组中的数据](http://stackoverflow.com/questions/2826233/removing-duplicates-in-an-array-in-c) – 2011-04-05 16:07:38