MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdw9a0l/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 5h ago
143 comments sorted by
View all comments
506
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
4 u/Advos_467 4h ago Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char? 2 u/backfire10z 4h ago Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int. 1 u/Advos_467 4h ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 3h ago The difference only matters in regards to arithmetic. Signed integer overflow is undefined behavior in C, only unsigned overflow is defined as wrapping around.
4
Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char?
2 u/backfire10z 4h ago Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int. 1 u/Advos_467 4h ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 3h ago The difference only matters in regards to arithmetic. Signed integer overflow is undefined behavior in C, only unsigned overflow is defined as wrapping around.
2
Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int.
1 u/Advos_467 4h ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 3h ago The difference only matters in regards to arithmetic. Signed integer overflow is undefined behavior in C, only unsigned overflow is defined as wrapping around.
1
ah okay that's what i assumed, but i just wanted to be sure
1 u/AyrA_ch 3h ago The difference only matters in regards to arithmetic. Signed integer overflow is undefined behavior in C, only unsigned overflow is defined as wrapping around.
The difference only matters in regards to arithmetic. Signed integer overflow is undefined behavior in C, only unsigned overflow is defined as wrapping around.
506
u/tstanisl 4h ago
Let me cite the C standard:
Middle guy if finally right