logoalt Hacker News

AlotOfReadingtoday at 5:37 PM1 replyview on HN

The object it's inside will still take up at least one byte.

    sizeof(struct {bool a:1;}) == sizeof(char);

Replies

hinkleytoday at 5:47 PM

Amortization.

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.

show 1 reply