Pushok icon

remove chars' repeats

Pushok | PRO | 08/19/11 04:54:24 PM UTC | 0 ⭐ | 425 👁️ | Never ⏰ | []
C++ |

280 B

|

None

|

0 👍

/

0 👎

void RemoveDoubleSymbols(char* str, int length)
{
    for(int i = 0; i < length; i++)
    {
        for(int k = i+1; k < length; k++)
        {
            if( str[i] == str[k] && str[i] != '\0' )
            {
                for(int j = k; j < length; j++)
                {
                    str[j] = str[j + 1];
                }
                i--;
            }
        }
    }
}

Comments