4 ms·
sizeof(char) is 1, always. By definition. Sizeof()’s return answer is in units of “number of chars”.
by nrclark 6y ago
sizeof(char) is 1, always. By definition. Sizeof()’s return answer is in units of “number of chars”.
- shakna 6y agosizeof(char) is a _minimum_ of 1, always, by definition. But it is not always 1, though most modern platforms are. > Their implementation-defined values shall be equal or greater in magnitude... - ISO/IEC 9899:201x, Annex E, 5.2.4.2.1
- layoutIfNeeded 6y agoWrong. The quoted part of the standard doesn’t talk about sizeof(char). Sizeof returns the size of its operand in char-sized units, therefore sizeof(char) is tautologically 1.