1.) Name these arguments i.e (string word, char vowel)
2.) You've defined the function in the wrong manner
1 2 3 4 5 6 7 8 9
int vowelsNumbersof(string str)
{
int i, count = 0;
for(i=0; i < str.length(); i++) //Sets to 0 and sets length
if(str.at(i)==count) count++; //Returns to ith position (0)
return count;
}
You're only passing in the word, and not the vowel you need check for in the first place. You're also not using your if-statement correctly. You should be checking str.at(i) == vowel not the count. If that comparison is true then you'll increase count.
1 2 3 4 5 6 7 8 9 10
int vowelsNumbersof(string str, char vowel)
{
int i, count = 0;
for(i=0; i < str.length(); i++) //Sets to 0 and sets length
if(str.at(i) == vowel)
count++; //Returns to ith position (0)
return count;
}