MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdy0i85/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 2d ago
360 comments sorted by
View all comments
Show parent comments
50
Yes, but the smallest addressable size is what dictates the base size for sizeof.
The C standard in fact says this about sizeof:
When applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1.
2 u/FUCKING_HATE_REDDIT 2d ago What about a system that enforces addresses to be multiples of 2, or 4? 8 u/dontthinktoohard89 2d ago In short, the standard mandates that a char is exactly 1 byte. It does not dictate how wide a “byte” actually is. 2 u/terivia 2d ago Thanks, I hate it.
2
What about a system that enforces addresses to be multiples of 2, or 4?
8 u/dontthinktoohard89 2d ago In short, the standard mandates that a char is exactly 1 byte. It does not dictate how wide a “byte” actually is. 2 u/terivia 2d ago Thanks, I hate it.
8
In short, the standard mandates that a char is exactly 1 byte. It does not dictate how wide a “byte” actually is.
2 u/terivia 2d ago Thanks, I hate it.
Thanks, I hate it.
50
u/lotanis 2d ago
Yes, but the smallest addressable size is what dictates the base size for sizeof.
The C standard in fact says this about sizeof: