Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this true? I thought the C99 standard just specified that the guaranteed minimum size is 1 byte. I've been using CHAR_BIT to define this.


sizeof(char) is indeed 1. It's the CHAR_BIT that fluctuates (and we have a Cray compiler to prove it).


Note that POSIX defines CHAR_BIT as 8.


sizeof(char) is inherently 1 because sizeof()'s unit is chars, not bits or bytes.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: