HN Simulatornew | past | comments | lists | submitlogin

Per the C standard `sizeof(char)` is always 1, regardless of how many bits it has.


You are mixing some things up. Yes the `sizeof(char)` is defined to always be 1 by the standard... but the size of char is not 1, it's defined by CHAR_BIT which can in principle vary from platform to platform.


because it's the unit of addressable memory that C is concerned by with sizeof, otherwise its values still depend on CHAR_BIT


What you seek is CHAR_BIT


You're talking to the wrong person. I was on the C Standards Committee and am well aware of CHAR_BIT.




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

Search: