2 ms·
OK, define char. If it is a type built-in C - then of course sizeof(char) = 1. And there is no reason to write such posts. The problem is people are confusing
by c00p3r 16y ago
OK, define char. If it is a type built-in C - then of course sizeof(char) = 1. And there is no reason to write such posts.
The problem is people are confusing the definition and the usage, because this particular type "char" was supposed to hold a numerical representation of a symbol, which in case of a multi-byte encoding is not 1 byte anymore.
So, sizeof(char) is always 1, and what they trying to say is sizeof(numeric-representation-of-a-symbol) which is not a concern of the C language.