ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Понедельник
22 июля
1016362 Топик полностью
RxTx (07.07.2020 05:17, просмотров: 284) ответил maleon на А я, грешным делом, думал, что sizeof возвращает размер в байтах, а не в char-ах
6.5.3.4 The sizeof operator 

Semantics

2Thesizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type.The size is determined from the type of the operand.The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.


K&R: «Strictly, sizeof produces an unsigned integer value whose type, size_t, is defined in the header <stddef.h>.»

<limits.h> содержит CHAR_BIT.

Спасибо, князь. Вы настоящий дворянин. И программист.