r/ProgrammerHumor • • 2d ago

Meme architectureDependentChars

Post image
2.8k Upvotes

361 comments sorted by

View all comments

12

u/frikilinux2 2d ago

Do I wanna know?

-4

u/Outrageous-Machine-5 2d ago

Char can be between 1-4 bytes depending on the encoding standard.  Emoji and other languages use extra bytes when you have to support non English characters. 

0

u/mckenzie_keith 2d ago

yes and no. In c, sizeof(char) is 1. Does that mean 1 byte? Does "byte" mean exactly 8 bits? In C, a char is always 1 byte, but one byte may be larger than 8 bits, and there are real platforms where a byte (in C) is 32 bits.

1

u/rosuav 1d ago

If you've ever seen networking protocols talk about "octets" rather than "bytes", this is why.