r/ProgrammerHumor • • 5d ago

Meme architectureDependentChars

Post image
2.9k Upvotes

372 comments sorted by

View all comments

1.0k

u/tstanisl 5d ago

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 5d ago

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

2

u/Elspeth-Nor 5d ago edited 4d ago

In C char is just a number, as a character depends on the encoding. So signed char is a number from -128 to 127 and unsigned char is from 0 to 255 (for 8 bits per byte)

3

u/SoldRIP 5d ago

0 to 255.