I know is something really stupid

Nov 13, 2015 at 3:32am
I dont know why my return proto type is having a error. Im sure is something really simple, but iv'e been working on it for 45 min. and still cant find the error.



#include <iostream>

using namespace std;

return bool isVowel(char ch)

int main()
{
char ch;
cout << "Enter a character from the alphbet:" << endl;
cin >> ch;
cout << "Is " << ch << " a vowel?" << isVowel << endl;
}

bool isVowel(char ch)
{
switch (ch)
case 'A':
case 'a':
case 'E':
case 'e':
case 'i':
case 'I':
case 'o':
case 'O':
case 'U':
case 'u':
return true;
default:
return false;
}
Last edited on Nov 13, 2015 at 3:33am
Nov 13, 2015 at 3:44am
That's not how you write a function prototype - you're also missing a semi-colon.

bool isVowel(char ch);
This is what your function prototype should look like.
You should also add some break statements to your switch in the isVowel function.
Nov 13, 2015 at 3:57am
Thank you my good sir.
Topic archived. No new replies allowed.