2 ms·
but people somehow sometimes seem to magically expect "certain" literals to be unsigned just because they're hex, and that's not how it works Indeed, and in th
by userbinator 11y ago
but people somehow sometimes seem to magically expect "certain" literals to be unsigned just because they're hex, and that's not how it works
Indeed, and in the most general sense, the signed/unsigned is really nothing more than how those 32 bits are interpreted by whatever operates on them. C attaches a particular type to literals which is used by the built-in operators, but things like printf() to a certain extent will do their own interpretation, as this shows:
printf("%d %u %x", 0x81000000, 0x81000000, 0x81000000);
This is definitely a concept that seems quite unfamiliar to those used to higher-level languages.