C - Ternary Operator
The conditional (ternary) operator ?: selects between two expressions based on a condition.
Syntax
cond ? expr_if_true : expr_if_falseExample
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_falseint abs_i(int x) { return (x >= 0) ? x : -x; }