Feb 10, 2015 at 4:38pm UTC
Hi,i am unsure how to write a function which modifies the content of the 1D character array and counts the number of the vowels. the following is the array that i have.
char text[MAX+1] = {'T', 'e', 's', 't', 'e', 'r', EOT};
the output that i am trying to produce is should look something like this
the number of vowels is 2, e, e.
i am unsure how to do this.
thanks for reading any help would be appreciated :D
Feb 10, 2015 at 5:37pm UTC
Loop over each character in your character array.
Test each character to see if it is a vowel.
If it is, increment a counter for the number of vowels.
Last edited on Feb 10, 2015 at 5:37pm UTC
Feb 10, 2015 at 5:42pm UTC
Thanks so much for your help!!!
i am a bit of a novice at c++ so could you explain to me how i can loop over each character.
many thanks