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

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -