I am trying to write a program that will remove any double letters from a surname, ie if I entered harris it would return haris.
I am trying to pass an array which is entered into the main program to the function rmdoub, firstly I get an error in the compiler telling me, incomparable types in assignment on the line where I try to pass the function the array. I have commented on this line to show it.\
I'm not sure what is wrong with the syntax but the program doesn't work and I would really appreciate some help.
Thanks guys
Code:#include <stdio.h> char rmdoub(char surname[], int n) { int num; int i = 0; int j; int k; while (i < num){ j = i + 1; printf("%d", j); printf("%d", i); if (surname[j] = surname[i]){ k = i; printf("%d", k); printf("%d", num); num = num - 1; while (k < num){ surname[k] = surname[j]; printf("%s", "c"); printf("%s", surname); k = k + 1; j = j + 1; } } num = num + 1; i = i + 1; } printf("%s", surname); } int main () { char surname[40]; int num; char rmsurname[40]; printf("Please enter the surname you wish to encode into the SOUNDEX index\n"); scanf("%40s", surname); num = strlen(surname); surname[num] = '\0'; printf("%d", num); printf("%s", surname); surname = rmdoub(surname, 40); *// This is the line that I am getting an error on// }



LinkBack URL
About LinkBacks


