Name: Anonymous 2011-09-29 14:54
What should
do?
a ? b = c : b = d do?
a ? b = c : b = d ?: operator has lower precedence than assignment, so both of the assignments will be executed (in undefined order). Then a will be evaluated and the expression will return the value of b = c if a is non-zero or b = d otherwise. The assignment operator returns what was assigned, so the result of the expression will be either c or d.