[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
? : Condition operator (ternary)
exp ? e1 : e2 Ternary conditional operator
exp any expression
e1, e2 any expression
The ? : operator evaluates either expression e1 or e2, depending upon
the truth of exp. If exp yields a TRUE value, e1 is evaluated and that
is the value returned; otherwise, e2 is evaluated, and that is the
value returned.
k = (i > j) ? i : j; /* This is equivalent to: k = max(i,j) */
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson