3 ms·
I personally prefer int x = (cond) ? 5 : 1; Since the question mark applies to the condition and not the 5. This also highlights the 2 pos
by bern4444 6y ago
I personally prefer
int x = (cond) ?
5 :
1;
Since the question mark applies to the condition and not the 5. This also highlights the 2 possiblities of the value in a more clear way. The two possible values are directly stacked with nothing in front of them.