-
Confused by '&' oparator
Hi!
What is the '&' oparator in this statement?
cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2 ;
"reference", "bitwise" or "address of" operator?
I think it cant be "reference" and "address of" because it wasnt declared.
But if it "bitwise" oparator, where is the second argument?
-
It's a bitwise and, and the second argument is 1.
--
Mats
-
It is bitwise and. That parenthesized expression can be expressed as: ((tm.tmPitchAndFamily & 1) ? 3 : 2).
-
Thank you Matsp and Laserlight, i understand it now.
What confused me was the missing parentheses inside (( tm.tmPitchAndFamily & 1) ? 3 : 2).
Next time im gonna imagine it there if i see an expression like that.