Jack Klein <> writes:
> On Thu, 29 Sep 2005 00:40:06 +0200, Skarmander
> <> wrote in comp.lang.c:
>
> > Flash Gordon wrote:
> > > QQ wrote:
> > >
> > >> I know a char is 2 bytes, the conversion is like
> > >
> > >
> > > Not in C it isn't. In C a char is 1 byte by definition, although that
> > > byte can be more than 8 bits.
> > >
> > But, for completeness, not less. And see below -- a char *may* be two
> > bytes, depending on how you define "byte". (How the OP defines it is
> > anyone's guess.)
>
> No, it may not, not in C and not among actually literate computer
> professionals.
>
> If a char contains more than 8 bits, it is certainly larger than on
> "octet", and may indeed be two or even four "octets" in size.
The statement about how computer professionals use the term byte
doesn't match my experience. In most cases (80%, perhaps?), most
computer people I know use "byte" to mean 8 bits, or at least to mean
8 bits unless stated otherwise (eg, "10 bit bytes", as opposed to just
"bytes"). And the sorts of people I'm thinking of certainly would
qualify as literate.
Of course what Jack about the term "byte" is right in the context of
discussing Standard C. For a broader audience, however, it's reasonable
to expect that many of them will take "byte" to mean 8 bits unless there
is an explicit statement giving another meaning to the term.
|