unsigned short s;
s = 0xffff;
int i = s;
How does the extension work? Added 2 bytes of a larger order, but I'm confused by the fact that there is 1 or 0. Probably it depends on the platform, so let's focus on what Unix does. Will two large bytes of order int be filled with 1 or 0, and why?
Basically, does the computer know what sis unsigned and correctly assign 0 higher order bits to int? So inow 0x0000ffff? Or, since it intsis signed by unix by default, is it necessary to use a bit-bit from s(a 1) and copy it to higher-order bytes?
source
share