Skip to main content

IAR Embedded Workbench for RISC-V 3.40

? : Conditional operator

In this section:
Syntax
condition ? expr : expr
Precedence

15

Description

? results in the first expr if condition evaluates to true, and the second expr if condition evaluates to false.

Note

The question mark and a following label must be separated by space or a tab, otherwise the ? is considered the first character of the label.

Example
5 ? 6 : 7 –>6
0 ? 6 : 7 –>7