Content deleted Content added
Moggie2002 (talk | contribs) m Fix reference, remove unreferenced tag. |
Moggie2002 (talk | contribs) m →Result type: correct presumed typo |
||
Line 64:
===Result type===
Clearly the type of the result of the <code>?:</code> operator must be in some sense the [[type unification]] of the types of its second and third operands. In C this is accomplished for [[numeric type]]s by [[arithmetic promotion]]; since C does not have a [[type hierarchy]] for [[pointer]] types, pointer operands may only be used if they are of the same type (ignoring [[type qualifier]]s) or one is [[void]] or [[NULL]]. It is [[undefined behaviour]] to mix pointer and integral or incompatible pointer types; thus
<source lang="c"
will result in a [[compile-time error]] in most compilers.
|