Can any of you explain how this statement works--ie: the logic behind this statement--especially the underlined part(the part before the conditional statement, but after the assignment operator): cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2 ;
**Note**
----------------------------------------------------------------------------------
I have some knowledge about fonts and the conditional operator.
----------------------------------------------------------------------------------
This is a bitwise AND operator on the variables 1 and tm.tmPitchAndFamily. This gives a value of 1 if the lowest bit of tm.tmPitchAndFamily is 1, and zero otherwise.
?
This checks the result of the previous operation. If it is non-zero, then 3. If it is zero, then 2.
(tm.tmPitchAndFamily & 1 ? 3 : 2)
So this will produce 3 if the lowest bit of tm.tmPitchAndFamily is 1, and will produce 2 otherwise.