C - Ternary Operator
The conditional (ternary) operator ?:
selects between two expressions based on a condition.
Syntax
cond ? expr_if_true : expr_if_false
Example
int abs_i(int x) { return (x >= 0) ? x : -x; }
The conditional (ternary) operator ?:
selects between two expressions based on a condition.
cond ? expr_if_true : expr_if_false
int abs_i(int x) { return (x >= 0) ? x : -x; }