[SDL] Get pixel value ...more in details

Mattias Engdegård f91-men at nada.kth.se
Thu Aug 30 08:48:00 PDT 2001

"Rainer Deyke" <root at rainerdeyke.com> wrote:
>I don't have a copy of the Standard, but I can quote K&R.

Rainer usually knows what he is talking about but please note that
integral promotion is one of the things that changed from K&R to ANSI C89
(C89 uses value-preserving semantics for signedness of types, K&R uses
preservation of signedness. Most people believe this was one of the few
places where C89 was a change for the worse)

>assert(((char)1 << (char)8) == 0x100);

keep in mind that the shift operators don't behave exactly like the other
binary operators regarding type promotion, since the size of the shift
amount (the right hand side) doesn't really affect the size of the result

Also note that you can buy the latest C Standard online for ANSI
in PDF format for just 18 USD. I would urge anyone taking C programming
at all seriously to get it

More information about the SDL mailing list