Frage im Vorstellungsgespräch bei Golden Frog

write a ternary operator replacement function

Antwort im Vorstellungsgespräch

Anonym

18. Juli 2013

The trick is that a function call will evaluate all the parameters, prior to making the call, where the ternary only evaluates the operation chosen by the conditional. You have to use functions pointers to avoid evaluation till after the conditional test.