Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the tenary operator in C with 3 numbers
#12
(08-08-2024, 08:53 PM)Pete Wrote: I look at it as shorthand...

C=(A>B)?A:B; 

meaning:

If A > B Then C = A Else C = B

Pete

Yeah @a740g if that is the Ternary then it's the more familiar (to me at least)
IFF as in IFF(expression, ReturnThisTrueValue, ElseReturnThisValue)
ServeBeverage$= IFF$(age>=18, "Beer," "Juice")

and maybe not so popular in QB64 land because you have to Type the function returns.
b = b + ...
Reply


Messages In This Thread
RE: Using the tenary operator in C with 3 numbers - by bplus - 09-12-2024, 02:17 PM



Users browsing this thread: 4 Guest(s)