Originally Posted by
CornedBee
That's actually a correct change. Just remember to use 0 for A, 1 for E, etc. Also, are you forgetting to count lowercase vowels?
I am coding it so that it accepts lower case vowels only at the moment, I can change that later but its good to go for the moment.
@laserlight, here is my current code:
Code:
#include <iostream>
#include <string>
int main()
{
string response;
int array [5]= {0, 0, 0, 0, 0};
cout << "enter a string of text\n" << endl;
cin >> response;
for(int i=0;i<response.length();i++)
{
if (response == "a") //invalid identifier
array[0]++;
if (response == "e") //invalid identifier
array[1]++;
}
cout << array[1]; //doing this as a test but get 0 no matter how many e's I type in.
return 0;
}