No. Neither Perl nor C uses the term "byte" to refer to a class of (unsigned) integers. A byte is the minimal addressable unit of memory. For the vast majority of modern, non-specialist cpus, that means 8-bits. And an 8 bit byte can vaiously contain unsigned integers 0-255, or signed integers -127-127, or 8 discrete boolean values.

Wikipedia says: The byte ... is an ordered collection of bits, in which each bit denotes the binary value of 1 or 0. The size of a byte is typically hardware dependent, but the modern de facto standard is 8 bits, as this is a convenient power of 2.

perlunicode says: Beginning with version 5.6, Perl uses logically-wide characters to represent strings internally. In future, Perl-level operations will be expected to work with characters rather than bytes. ... Under character semantics, many operations that formerly operated on bytes now operate on characters.

It makes a whole lot more sense than "a byte can be stored in 1 byte or it can be stored in multiple bytes. But when it is stored in multiple bytes it is still just 1 byte". Of course, you'll probably start talking about that pretentious term 'octet' coined to be unambiguous, but unless your using a 12-bit or 40 bit dsp, there is no ambiguity. And if you are, the term octet is meaningless.


In reply to Re^60: Interleaving bytes in a string quickly by Anonymous Monk
in thread Interleaving bytes in a string quickly by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.