The terminal operator C can never be short-circuited, since it evaluates only one expression a (condition) to determine the value given by expressions b and c if any value can be returned.
The following code:
int ret = a ? b : c;
This is almost equivalent to the following code:
int ret; if(a) {ret = b} else {ret = c}
The expression a can be formed by other operators, such as && or || which may be a short circuit, because they can evaluate two expressions before returning the value, but this will not be considered a triple operator performing a short circuit, but the operators used in the condition, as in a regular if.
Update:
There is some discussion that the triple operator is a short circuit operator. The argument says that any operator that does not evaluate all its operands makes a short circuit according to @aruisdante in the comment below. If this definition is given, then the ternary operator will be shorted, and in this case I agree with this initial definition. The problem is that the term “short circuit” was originally used for a certain type of operator that allowed this behavior, and these are logical / logical operators, and the reason that this is only what I will try to explain.
Following the article "Detection of short circuits," the evaluation of a short circuit applies only to logical operators embedded in the language, such that knowing that the first operand will make the second inappropriate, that is, for &&, the operator is the first operand is false , and for || the operator is the first operand true ; the C11 specification also notes this in 6.5.13 the logical AND operator and 6.5.14 the logical OR operator.
This means that to determine a short circuit, you must define it in an operator that must evaluate all operands in the same way as logical operators, if the first operand does not make the second unnecessary. This corresponds to what is written in another definition of a short circuit in MathWorks in the Logical Short Circuit section, since the short circuit comes from logical operators.
As I tried to explain the C-ternary operator, also called the triple, if it evaluates only two of the operands, it evaluates the first, and then evaluates the second, or one of the two remaining, depending on the value of the first. He always does this, and should not evaluate all three in any situation, so there is no “short circuit” in any case.
As always, if you see that something is wrong, write a comment with an argument against it, and not just with downvote, which just makes SO worse, and I believe that we can be a much better community, just answers with top-down answers do not agree.