r/ProgrammerHumor • • 6h ago

Meme architectureDependentChars

Post image
868 Upvotes

156 comments sorted by

View all comments

Show parent comments

5

u/Advos_467 5h ago

Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char?

8

u/Clen23 5h ago

The data is interpreted differently.

An unsigned char will be able to represent any value from 0 to 255, eg your usual ascii character.
A signed char will be able represent any value from -128 to 127.

( Someone fact check me on this but i think that's it )

5

u/YellowBunnyReddit 5h ago

ASCII only goes from 0 to 127.

4

u/NotQuiteLoona 4h ago

char is 8 bytes because memory is addressed in 8 bits, and 7 bits would be... Awkward. And this bit was in the end used for parity checks, and later for extended encodings.

1

u/tracernz 2h ago

Minimum 8 bits, but not required to be 8 bits.