How to assign value to a struct with bit-fields?

前端 未结 4 546
耶瑟儿~
耶瑟儿~ 2020-12-30 09:05

I have a struct with bit-fields (totally 32 bit width) and I have a 32-bit variable. When I try to assign the variable value to my struct, I got an error:

4条回答
  •  旧巷少年郎
    2020-12-30 09:37

    Just if somebody´s interested, I´ve got a better solution for my own question:

    *(reinterpret_cast (&CPUIDoutput)) = CPUIDregsoutput.EAXBuf;
    

提交回复
热议问题