The function strcpy doesn't work

I had a homework saying that i should

create a program which takes a string and remove all successive repetitions in it.

i don't know why it doesn't work, this is my code :

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>

int main()
{
    char ch[50];
    gets(ch);
    int i;
    for (i=0;i<strlen(ch)-1;i++);
    {
        while (ch[i] == ch[i+1])
            strcpy(ch+i,ch+i+1);
    }
    puts(ch);
    return 0;
}

Answers


Remove the ; after for loop because it terminates the loop and is wrong.


Need Your Help

Using Left Join in 3 tables

sql oracle plsql oracle-sqldeveloper plsqldeveloper

I'm trying to join 3 tables using LEFT JOIN, but I always have an error. Please help me.

Rails 4 update data using xml and jquery

javascript jquery ruby-on-rails ajax

I'm trying to automaticly update data using a ajax call out of jquery.