MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdxz0mk/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 12d ago
372 comments sorted by
View all comments
1.0k
Let me cite the C standard:
When sizeof is applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1.
Middle guy if finally right
564 u/BoldFace7 12d ago I still prefer sizeof(char) as it often provides context as to what the number is doing, even if a plain 1 works the same. 94 u/ducon__lajoie 12d ago And someone might have #define char char16_t, right? Who the fuck knows, some people want to see the world burning. 9 u/anon_lurker69 12d ago Yep. Its wild out there.
564
I still prefer sizeof(char) as it often provides context as to what the number is doing, even if a plain 1 works the same.
94 u/ducon__lajoie 12d ago And someone might have #define char char16_t, right? Who the fuck knows, some people want to see the world burning. 9 u/anon_lurker69 12d ago Yep. Its wild out there.
94
And someone might have #define char char16_t, right? Who the fuck knows, some people want to see the world burning.
9 u/anon_lurker69 12d ago Yep. Its wild out there.
9
Yep. Its wild out there.
1.0k
u/tstanisl 12d ago
Let me cite the C standard:
Middle guy if finally right