I want to use a function that returns a uint32_t
which is supposed to contain 8 bits of information, in little-endian format. Could someone give me some C++ code on how to extract these bits from the uint32_t
type into chars, booleans or into any other type that does not need the use of the Force to deal with! Because right now I do not have the patience to understand the whole concept of endianess. And the more I shallowly search the more complicated it seems...
PS. Although not what I am looking for, if someone could also post some code on how one could encode 8 bits (ex. 8 booleans) in an uint32_t
would be interesting as I think it would help me understand the concept.