Can some one translate this bit of C into BASIC?

Started by Baggey, May 21, 2024, 18:24:07

Previous topic - Next topic

Baggey

( outitemp & 0x80 ? FLAG_N : 0 )


Does this mean that , If ( outitemp & 128) ie, if bit7 of outitemp is a 1 then it will be TRUE and if bit7 of outitemp is a 0 then it will be FALSE.

After the ? mark is this now a decision where we pick the value of either (FLAG_N or 0) dependinging on the TRUE or FALSE outcome?

If so which side of the : is TRUE or FALSE? ???

Or have i completely misunderstood?

Thanks in advance BAGGEY
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!


Baggey

#2
Quote from: dawlane on May 21, 2024, 18:39:04Read
https://en.wikipedia.org/wiki/Ternary_conditional_operator
Cool Link :D

I wish my learning curve would peterout! But it still feels exponential :o

Thankyou.
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!