Error String subscript out of range of line 24.Don't know what exactly the error is. storeletterscore should be a number value of zero. Meanwhile, when zero is entered in that cout<<letters[store_letter_score][column]; which it does but gives me the error saying out of range. Why?
enum alphbet {a,b};
void printoutusersentence ( string &usertypes)
{
cout<<"\n\nType in a sentence: ";
cin>>usertypes;
int index=0;
for (int column=0;column<5;column++)
{
//declare a variable to store in a character. Declare enum type variable to store in a value
alphbet store_letter_score;
char letterstore=usertypes[index];
switch (letterstore)
{
case'a':store_letter_score=a;
break;
case'b':store_letter_score=b;
break;
}
cout<<letters[store_letter_score][column];
cout<<endl;
index++;
}
}