Hey guys iam new in c and iam learning on my own, I have a task in book which is well complicated(at least for me) .(it want me to create the file , insert the text then copy text without vowels into a new file).
I know i have long way to go with this , so far i figured out how to count vowels ,
but I am trying to find the way for the actual removing vowels from text,

file handling ill manage somehow..
Any help would be nice.. its a challenge for me to learn c but i can't learn everything on my own .. THX for help ..

#include<ctype.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>


void main(){
char str[100];
int cnt=0;
char vowels[]={"aeiou"};
int i,j;
clrscr();

printf("enter the string  :  ");gets(str);fflush(stdin);
      for(i=0;i<strlen(str)!=NULL;i++){
      str[i]=tolower(str[i]);
      }


      for(i=0;i<strlen(str)!=NULL;i++)
    for(j=0;j<strlen(vowels)!=NULL;j++)
      { if(str[i]==vowels[j])
     cnt++;
       }
      printf("the number of vowels is :%d " ,cnt);


      getch();
      }

In this task you don't have remove the vowels just don't write them to the new file. Just be sure to read the input file one character at a time. If the character is a vowel the do nothing, if the character is not a vowel then write it to the output file.

:) Thank youuuuuuu ,This is really good point that i didn't realize .I see i need to start reading tasks properly and try to make it as simply as possible(and find the solution). Thank you again ..Now Ill gonna figure out the file handling. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.