Remove repeat char from a string

i search in google to find the solution remove repeat char from a string, but failed. so write it by myselft....
i use C.

char * RemoveRepeatChar(char *S){
char *temp=S, *move;
//1. base ==Null
if(*s) return null;
   while(*S){
        temp = s+1;
        while(*temp){
              //repeat char  
              if(*temp == *S)
                {
                        move = temp;
                        while(*move)
                            *move++=*(move+1);
                }
               else
                    temp++;
         }
    S++;
   }
}
posted @ 2007-09-18 15:13  HonestMan  阅读(559)  评论(4编辑  收藏  举报