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.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Serial Numbers AtomicSlaughter 1 767 03-13-2023, 05:45 PM
Last Post: mnrvovrfc

Forum Jump:


Users browsing this thread: 1 Guest(s)