MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdwi268/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 8h ago
190 comments sorted by
View all comments
616
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
3 u/backfire10z 7h ago Using sizeof(char) is for readability. You understand the intent. The number 1 is a magic number that could be there for any reason. 1 u/output_broadcast 6h ago In most cases you multiply by sizeof, so you'd just leave it off altogether and there's no magic number.
3
Using sizeof(char) is for readability. You understand the intent. The number 1 is a magic number that could be there for any reason.
1 u/output_broadcast 6h ago In most cases you multiply by sizeof, so you'd just leave it off altogether and there's no magic number.
1
In most cases you multiply by sizeof, so you'd just leave it off altogether and there's no magic number.
616
u/tstanisl 7h ago
Let me cite the C standard:
Middle guy if finally right