0
Boolean determines value?
What Is the (?5:55) portion of this code doing? I’ve tried google, but I don’t know how to describe It. Also, Is there a chapter In SoloLearn that I could reference? https://code.sololearn.com/c2FUwA4PdnfW/?ref=app
3 Respostas
+ 1
It is called a - conditional operator (? :) OR a ternary operator (it takes three operands). The conditional operator works as follows: The first operand is implicitly converted to boolean value (i. e. Value 0 /1). It is evaluated and all side effects are completed before continuing. If the first operand evaluates to true (1), the second operand is evaluated. Else, 3rd operand is evaluated.
+ 1
look up ternary operator.
0
thank you, that answers my question.