Originally Posted by Hunter2
>>So that means if you set value to a value in that union, you could take it apart 8 bits at a time, right?
Well, I'm not 100% sure about this part, but the variables in the struct may not be arranged as you expect. I don't have a copy of the C++ standard so I can't check up on this, but I think all that's guaranteed of a struct is that the declared variables exist *somewhere* in that block of memory and are of the type specified. AFAIK, the compiler is allowed to optimize by rearranging the physical location of the variables within the struct, so unless you find a compiler switch to turn this off, the bits you're accessing might not be the ones you're looking for. Again, though, I repeat: I could be totally wrong about this, or it might not apply to structs with bitfields, or anything in between, but you should look it up just in case.