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 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, 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 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on 2 x HP Z24's . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!