Does C sign extend or zero extend constants? -



Does C sign extend or zero extend constants? -

does c sign extend constants or 0 extend them? example:

int = 123 & 0x3

is 0x3 0 extend or sign extended? in general, things 0 extended in c , sign extended?

thanks!

the c standard not mandate whether implementation uses 2's complement, 1's complement, or else. representation of negative values not mandated either.

however, in particular case, 0x3 positive value, sign-extension , zero-extension same thing!

c

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -