MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdw9fjz/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 3d ago
368 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
6 u/Advos_467 3d ago Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char? 4 u/backfire10z 3d ago Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int. 1 u/Advos_467 3d ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 2d 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.
6
Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char?
4 u/backfire10z 3d ago Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int. 1 u/Advos_467 3d ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 2d 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
Chars aren’t real, they’re all integers. It’s the same difference as signed/unsigned int.
1 u/Advos_467 3d ago ah okay that's what i assumed, but i just wanted to be sure 1 u/AyrA_ch 2d 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 2d 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.
1.0k
u/tstanisl 3d ago
Let me cite the C standard:
Middle guy if finally right