logoalt Hacker News

RobotToastertoday at 5:19 PM2 repliesview on HN

>and that it takes up one byte of memory

You can make them smaller using bitfields in C.


Replies

AlotOfReadingtoday at 5:37 PM

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

    sizeof(struct {bool a:1;}) == sizeof(char);
show 1 reply
russdilltoday at 5:32 PM

Um, no. Please show me how you can fit 255 possible states in something smaller than a byte by using bitfields.

show 1 reply