Operatore ternario c++

(condition) ? (value_if_true) : (value_if_false)

The conditional operator in C++ works by first evaluating the condition in the parentheses. If the condition is true, the value returned is the 'value_if_true' expression. If the condition is false, the value returned is the 'value_if_false' expression.