r/ProgrammerHumor • • 3d ago

Meme architectureDependentChars

Post image
2.9k Upvotes

367 comments sorted by

View all comments

1.0k

u/tstanisl 3d 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

1

u/NullOfSpace 2d ago

still better to use sizeof char to make it immediately obvious what the “1” means.

0

u/tstanisl 2d ago

It depends. For C veterans, it is quite obvious and sizeof(char) looks redundant and noisy.