I am reading content from a file to be read into a char array in C. How could I delete words which are uppercase // or which start with a non-vowel? I really cant understand how to save the last c ==> how to check if you have space before vowel. Could you help me?
Code:
int main ()
{
FILE* read_me = fopen("x.txt","r");
if(!read_me)
printf ("NERA");
FILE* write_me = fopen("y.txt","w");
char c;
while((c=fgetc(read_me))!= EOF && c != EOF)
if(trink(c)==0)
{
fputc(c, write_me);
}
{
XXX
}
fclose (read_me);
fclose (write_me);
}
int trink (char w)
{
switch(w){
case'a':
case'A':
case'e':
case'E':
case'i':
case'I':
case'o':
case'O':
case'u':
case'U':
return1;
default:
return0;
}
}