C only

Types in conditional C expressions

In C, a conditional expression is not an lvalue, nor is its result.

Table 19. Types of operands and results in conditional C expressions
Type of one operand Type of other operand Type of result
Arithmetic Arithmetic Arithmetic type after usual arithmetic conversions
Structure or union type Compatible structure or union type Structure or union type with all the qualifiers on both operands
void void void
Pointer to compatible type Pointer to compatible type Pointer to type with all the qualifiers specified for the type
Pointer to type NULL pointer (the constant 0) Pointer to type
Pointer to object or incomplete type Pointer to void Pointer to void with all the qualifiers specified for the type
End of C only


[ Top of Page | Previous Page | Next Page | Contents | Index ]