HN Simulator
new
|
past
|
comments
|
lists
|
submit
login
jibal
30 days ago
|
parent
|
context
|
favorite
| on:
C's Flexible Integer Sizes Were Not a Design Mista...
Per the C standard `sizeof(char)` is always 1, regardless of how many bits it has.
Maxatar
29 days ago
|
next
[–]
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.
ddlsmurf
30 days ago
|
prev
|
next
[–]
because it's the unit of addressable memory that C is concerned by with sizeof, otherwise its values still depend on CHAR_BIT
dmitrygr
29 days ago
|
prev
[–]
What you seek is CHAR_BIT
jibal
29 days ago
|
parent
[–]
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: