When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
19 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
I used this function
char delete_vowels(char *str)
{
int len = strlen(str);
for(int i =0 ; i< len ; i++)
{
if (str[i]=='a' str[i]=='i' str[i]=='u' str[i]=='e' str[i]=='o' str[i]=='A' str[i]=='I' str[i]=='U' str[i]=='E'|| str[i]=='O' )
for (int j = i ; j < len ; j++)
{
str[j] = str [ j + 1];
}
len--;
}
return str ;
}
This is in int main
Char str[100];
Printf(" inpur str : ")
Scanf("%s", str)
printf(" Output : %s ", delete_vowels(str));
str[i]=='a' str[i]=='i' str[i]=='u' str[i]=='e' str[i]=='o' str[i]=='A' str[i]=='I' str[i]=='U' str[i]=='E'|| str[i]=='O'
```are there supposed to be `||` inbetween all of these?
Also what is not working?
Yes
I had to write || too
But idk why it missing when i send the code in this chat
I mean there are multiple solutions. Either you write a delete_char(char * str, char to_delete) function and invoke it for all chars you want to delete individually, or if you want to solution better designed for your individual problem then you can just iterate over the string and whenever a char is not a vowel copy it as the next character into a second string
What does variables to_delete for?
Beg your pardon?
Char to_delete
Yes?
For?
What is your question?
Please make a whole sentence out of your question, I don't understand what you want
Hmmm forget it , now how to iterate over the string?