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

I always thought that 1 char was exactly 1 byte, but that 1 byte was not necessarily 8 bits?


I think from a C standards point of view, that's true; I was using the general convention of 1 byte=8 bits, but char being one or more of these bytes. Hence CHAR_BIT is the number of bits in a char, and sizeof gives the number of chars that would fit in the specified type.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: