Pushok

remove chars' repeats

Aug 19th, 2011
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. void RemoveDoubleSymbols(char* str, int length)
  2. {
  3.     for(int i = 0; i < length; i++)
  4.     {
  5.         for(int k = i+1; k < length; k++)
  6.         {
  7.             if( str[i] == str[k] && str[i] != '\0' )
  8.             {
  9.                 for(int j = k; j < length; j++)
  10.                 {
  11.                     str[j] = str[j + 1];
  12.                 }
  13.                 i--;
  14.             }
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment