how to serialize binary data?

Pages: 12
> i guess i am still unclear about why we are using bytes, or 8-bit values, at all?

A byte (char, signed char, unsigned char) is the fundamental unit of storage, and therefore the fundamental unit of addressibility in C++. The only way we can access some consecutive six bits in storage is by accessing it as six bits stored as part of a byte (or part of some object which occupies an integral number of bytes).

We are assuming that a byte is an octet (an 8-bit value) because in practice, on every C++ implementation, a byte is an octet.

The fundamental storage unit in the C++ memory model is the byte. A byte is at least large enough to contain any member of the basic execution character set and the eight-bit code units of the Unicode UTF-8 encoding form and is composed of a contiguous sequence of bits, the number of which is implementation-defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit. The memory available to a C++ program consists of one or more sequences of contiguous bytes. Every byte has a unique address. - IS
Topic archived. No new replies allowed.
Pages: 12