caramelleamare caramelleamare - 1 month ago 9x
C Question

Bit representation of a C vector

Working in little endian, which is excatly (including eof if there is) the bit representation of a C vector like this?

unsigned char vet[] = {0x0f, 0x05};


Bit representation of a vector of unsigned chars is not dependent on endianness, because char types are single-byte, while endianness tells you how multiple bytes are arranged in memory.

Therefore, 0x0f would be found at an earlier address in memory than 0x05, producing


including eof if there is [one]

Unlike C strings and arrays initialized with C strings, arrays initialized with curly brace initializers do not have an end mark.