Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ohyoutravel
on Nov 8, 2016
|
parent
|
context
|
favorite
| on:
So you think you know C?
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.
eps
on Nov 8, 2016
|
next
[–]
sizeof(char) is indeed 1. It's the CHAR_BIT that fluctuates (and we have a Cray compiler to prove it).
ori_b
on Nov 8, 2016
|
parent
|
next
[–]
Note that POSIX defines CHAR_BIT as 8.
plorkyeran
on Nov 8, 2016
|
prev
[–]
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: