I'm not sure what this does, can anyone help?
cxCaps and cxChar are both integers
It's mostly '& 1 ? 3 : 2)' That I don't know the meaning of.Code:cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2;
Thanx
Printable View
I'm not sure what this does, can anyone help?
cxCaps and cxChar are both integers
It's mostly '& 1 ? 3 : 2)' That I don't know the meaning of.Code:cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2;
Thanx
Where did you get this code. The absolutely same question was posted by abdul a while ago. Here is the link
I got it from a bloke called Charles Petzold. ;)
Would
andCode:cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2;
Do the same thing then?Code:cxCaps = (tm.tmPitchAndFamily ? 3 : 2) * cxChar / 2;
Whoops, I just stared blankly into the screen for 1/2 an hour and it hit me.
Is the same asCode:cxCaps = (tm.tmPitchAndFamily & 1 ? 3 : 2) * cxChar / 2;
I'm not the best @ C++ yet, sorryCode:cxCaps = ((!tm.tmPitchAndFamily & 0) ? 3 : 2) * cxChar / 2;
Yes, I am reading the same book. Is it programming windows 95 or windows 98?
I dunno, the title is Programming Windows 5th Edition by Charles Petzold :)
The author is giving almost the same examples in his window s programming books.
I am reading "Programming Windows 95"
:p
I've heard the term 'a lazy programmer is a good programmer ' used, but plz. That refers to programming only. ;) Not book writing.
Does it matter? :D
Ternary form is one of the easiest-confused operators - took me a while to learn it (I was still looking up which way round the true and false values went until about a month ago :p)