char seat;
letter = 'A';
char alphabet[26];
int seats_amt = 5; //this is actually a user defined var.
cin >> seat;
if (islower(seat))
seat = toupper(seat);
for (int i = 0; i < seats_amt; i++) {
alphabet[i] = i + letter;
if (seat == alphabet[i])
cout << "You entered " << alphabet[i] << endl;
else
{
cout << "Re-enter Letter.\n>";
cin >> seat;
}
}
the problem is that i need to check the input 'seat' against each iteration of the alphabet in the array. but alphabet[i] only works in the for loop bracket. But keeping it in the for loop spits out the ELSE bracket 5 (seats_amt) times.
i feel like its such a stupid and obvious thing that im missing here.