Typically the '?' operator is used in the following form:
A ? B : C
However in cases where B = A I have seen the following abbreviation
A ? : C
This surprisingly works. Is it better to leave the second parameter in (style wise), or is their a chance certain compilers won't be able to handle this?
It is not permitted by the language C (as far as I know), but compilers such as gcc have the shortcut a?:c as an extension. a?:c
means the same as a?a:c
.
Its a gcc's extension
Conditionals with Omitted Operands
x ? : y
is equivalent to x ? x : y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With