OT: Requesting C advice
Matthew Saltzman
mjs at clemson.edu
Thu May 24 14:03:52 UTC 2007
On Thu, 24 May 2007, Mike McCarty wrote:
> Mike McCarty wrote:
>> Matthew Saltzman wrote:
>
> [snip]
>
>>>
>>> sizeof(char) == 1 is guaranteed by the standard. There's no reference to
>>> "bytes", but it is commonly accepted that the char type is a byte.
>>
>>
>> Erm, from the Standard:
>>
>> 3.4
>> [#1] byte
>> addressable unit of data storage large enough to hold any
>> member of the basic character set of the execution
>> environment
>
> Also from the Standard:
>
> 3.5
> [#1] character
> bit representation that fits in a byte
>
>
> 6.5.3.4 The sizeof operator
> ...
>
> [#2] The sizeof 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.
>
> The word "byte" appears dozens of times in the Standard, not counting
> its appearance in the word "multibyte".
OK, OK you win. Sheesh!
--
Matthew Saltzman
Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs
More information about the users
mailing list