5 ms·
> Also sizeof(long) was 2 and sizeof(long long) was 4 Wait what? Doesnt that mean a byte somehow has 16 bits?
by ant6n 5y ago
> Also sizeof(long) was 2 and sizeof(long long) was 4
Wait what? Doesnt that mean a byte somehow has 16 bits?
- CyberRabbi 5y agosizeof() is measured in number of chars, I.e. sizeof(char) is always 1. As he said, char was also 16-bit.
- anyfoo 5y agoWhile you got an answer already, there was also a time where 8 bit wasn't standard yet, and computers existed in all kinds of word sizes. 18 bit, 36 bit, and even "variable size" (i.e. IBM 1401). The further back you go, the more it shatters what we consider "normal" and "essentially fixed" in today's computer world.