#include <stdio.h>
#include <string.h>
void vowel_check(char message[30], int i);
int main() {
char message[30];
while (fgets(message, 15, stdin) != NULL) {
int i = 0;
while (i < 30) {
vowel_check(message, i);
i++;
}
printf("%s\n", message);
}
}
void vowel_check(char message[30], int i) {
if (message[i] == 'a'
|| message[i] == 'e'
|| message[i] == 'i'
|| message[i] == 'o'
|| message[i] == 'u') {
message[i] = '\0';
i++;
}
}
So it was my first time learning strings, and I want to make a program that gets rid of all the vowels in the program.
ex) white milk -> wht mlk
I think I'm not stuck in something massive and extremely challenging, I think I didn't get the hang of strings just yet. Can anyone point out what part of my code I did wrong? Thanks!