问答

汇集网友智慧,解决技术难题

slf123123

TA的家园币:18  

  • 结构体按位对齐后的赋值

    typedefunsignedlongDWORD;#pragmapack(push)#pragmapack(1)typedefstructsi{DWORDa:4;DWORDb:7;DWORDc:3;DWORDd:1;DWORDe:3;DWORDf:14;}si;#pragmapack(pop)如上所示这个结构体对齐后是四个字节然后uint8buff[4];怎么将buff赋值给整个结构体structsisu={buff[0],buff[1],buff[2],buff[3]};这样赋值不行吗

    ig struct AC ck typedef structs

    2021-04-17 14