counting individual vowels in a sentence

I'm trying to get this program to work that will count the frequency of each vowel. Surely i am over looking something silly.

#include <iostream>
#include <string>

using namespace std;

int main(){
char sent[81];
cout << "Type up to an 80 character sentence." << endl;
cin.getline(sent, 81);

int a = 0;
int e = 0;
int i = 0;
int o = 0;
int u = 0;

int len = strlen(sent);

for (int count = 0; count < len; count++){

if (sent[count] == a){
a = a + 1;
}
else if (sent[count] == e){
e = e + 1;
}
else if (sent[count] == i){
i = i + 1;
}
else if (sent[count] == o){
o = o + 1;
}
else if (sent[count] == u){
u = u + 1;
}
}

cout << "There are " << a << " A's in that sentence." << endl;
cout << "There are " << e << " E's in that sentence." << endl;
cout << "There are " << i << " I's in that sentence." << endl;
cout << "There are " << o << " O's in that sentence." << endl;
cout << "There are " << u << " U's in that sentence." << endl;


return 0;



}
Capitol wrote:
Surely i am over looking something silly.

At a quick glance:
Yes, in your if statements put single quotes around the letters a, e, i, o and u.
yes either use ascii codes for each letter or just put single quotes before and after them like Script Coder said.
Topic archived. No new replies allowed.