You do have to have int a before the loop.(*) And since you have it, everybody's happy.
(*)You are allowed to have it inside the loop itself, as in
for (int a = 0; a < 3; ++a)
Type: Posts; User: tabstop
You do have to have int a before the loop.(*) And since you have it, everybody's happy.
(*)You are allowed to have it inside the loop itself, as in
for (int a = 0; a < 3; ++a)
A constant is something like 6. Or 11. Or 253. Something that is constant according to the English sense of the term.
Variable Definition | Definition of Variable at Dictionary.com
Constant Definition | Definition of Constant at Dictionary.com
I think you mean
int b(2);
and similarly for c. Also I don't believe you can use variables in case statements, only constants.