Alexandre Oliva writes:
> > [The number of bytes in a `]$1['.])
> ^^^^^ chars, actually
>
> sizeof(char) == 1 always holds, but it doesn't have to be a byte.
K&R1 says:
"The expression `sizeof(object)' yields an integer equal to the size of
the specified object. (The size is given in unspecified units called
`bytes', which are the same size as a char.)"
and
"The sizeof operator yields the size, in bytes, of its operand. (A byte is
undefined in the language except in terms of the value of sizeof. However,
in all existing implementations a byte is the space required to hold a
char.)"
So what Akim wrote is in fact right. The fact that sizeof(char)==1 is just
a historical coincidence that was standardized much later.
(It is true that chars do not have to be 8 bits, but depending on your
interpretation, neither do bytes. An alternative definition of a byte is
the smallest addressable unit in a computer. Now that all computers work
with multiples of 8 bits, this notion might have gotten lost.)
In any case, "the number of chars in a `long int'" seems unnecessarily
confusing.
--
Peter Eisentraut Sernanders väg 10:115
[EMAIL PROTECTED] 75262 Uppsala
http://yi.org/peter-e/ Sweden