Quote:
Originally Posted by Lee
Could you give an example or two please?
|
Code:
new a=1, b=2, c=3,d
d=a ? b : a + b
Could you tell what would be the result of this expression? It could be interpreted in many ways.
With the correct brackets:
But you have to be careful. It may not be what you want. You may want this:
Code:
d = (a ? b : a) + b
So if you have any doubts, just make sure the results of the expression are within brackets so you don't run in any problems like those, which can be hard to find out.
__________________