Hey everyone,
we're going over functions now and I am supposed to write a program that counts the number of vowels in string of characters. I'm not sure what I'm doing wrong... could someone help?
#include <iostream>
using namespace std ;
int isVowel ( string ) ;
int main()
{
int y ;
y = isVowel ("Enter a string of characters followed by a period: ") ;
cout << y ;
}
int isVowel ( string msg )
{
char ch ;
cout << msg ;
while ( ch != '.' )
{
cin >> ch ;
if ((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') || (ch == 'u'))
vowel++ ;
}
return vowel ;
}