I have two functions rmdup and rmvow, when I run these functions in isolation they work perfectly, but when they're together in a program they don't work at all?
int rmdup ( char name[] )
{
char nodup[20] = {''\0''};
int l = strlen(name);
int i = 0, j, k = 0;
while ( i < l )
{
j = i + 1;
if ( name[i] == name[j] )
{
nodup[k] = name[i];
i+2;
while(nodup[k] == name[i])
{
i++;
}
k++;
}
else
{
i++;
}
nodup[k] = ''\0'';
}
strcpy(name, nodup);
}
The above works in isolation, as does the below.
int rmvow ( char name[] )
{
char novow[20] = {''\0''};
int l = strlen(name);
int i = 0, j = 0;
while ( i < l )
{
if ( name[i] == ''a'' ||
name[i] == ''e'' ||
name[i] == ''i'' ||
name[i] == ''o'' ||
name[i] == ''u'' )
{
i++;
}
else
{
novow[j] = name[i];
i++;
j++;
}
novow[j] = ''\0'';
}
strcpy(name, novow);
}