| Author |
switch statement and compile time constatns.
|
Jan Osykowski
Ranch Hand
Joined: Jul 15, 2010
Posts: 41
|
|
Hey guys,
I have a question about the switch construction. In the book it's written that the case constant must be a compile time constant and thus i have a question to this code:
And it works but I think that b+ 2*b is not a compile time constant. What do you think? On the other hand this code doesn't work:
Why it's like this?
Cheers,
Jan.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Actually, if you mix your compile time constant with non-compile time constant then result become non-compile time constant
|
 |
Malatesh Karabisti
Ranch Hand
Joined: Jul 28, 2010
Posts: 143
|
|
|
Compile time constant will be formed only with Rules
|
 |
Jan Osykowski
Ranch Hand
Joined: Jul 15, 2010
Posts: 41
|
|
|
Alright, thanks for the answers!
|
 |
 |
|
|
subject: switch statement and compile time constatns.
|
|
|