I'm currently going though C++ Principals and Practices and starting on loops. I get the concept, how to use them, and what they're for but something is missing.
1 2 3 4 5 6 7 8
int main()
{
char a = 'a';
while (a < 150) {
cout << a << endl;
++a;
}
}
This causes an infinite loop and i'm not sure why. a is being incremented by 1 each time, yet the condition of (a < 150) is never met. I'm thinking it might have something to do with conversion / type promotion (or lack thereof) but am not sure. Maybe a isn't being evaluated as an int in the condition?
I realize this is an obnoxiously trivial question but can't seem to find an answer elsewhere. I apologize in advance if it's a repost or if i missed something.