return int_length(len > 0 ? len : 1) what is the meaning of the syntax in the brackets, I keep getting confused when reading this code. thanks
return int_length(len > 0 ? len : 1) what is the meaning of the syntax in the brackets, I keep getting confused when reading this code. thanks
That's the ternary operator.
It's equivalent to
if (len>0) return int_length(len); else return int_length(1); int_length. (Not that I think that's an valid reason to downvote, but it's the only criticism I can think of.)it means
if(len > 0) { return int_length(len); } else { return int_length(1); }