4 ms·
The object it's inside will still take up at least one byte. sizeof(struct {bool a:1;}) == sizeof(char);
by AlotOfReading 7mo ago
The object it's inside will still take up at least one byte.
sizeof(struct {bool a:1;}) == sizeof(char);
- hinkley 7mo agoAmortization. If one Boolean must be a byte then 8 must be eight bytes. Which is not true. A boolean can be 1/8th of a byte which is a meaningful distinction.
- hinkley 7mo ago3^5 is 243 so one could also call an optional Boolean 1/5th of a byte, though 1/4 is so much simpler to read and write.
- gottheUIblues 7mo agoA trit is log(3)/(8log(2))=0.19812031259014 of a byte