问答

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

1973chen

TA的家园币:60  

  • 联合体该如何设置某一位

    联合体如下:unionSFLAG{struct{uint8_tb0:1;uint8_tb1:1;uint8_tb2:1;uint8_tb3:1;uint8_tb4:1;uint8_tb5:1;uint8_tb6:1;uint8_tb7:1;uint8_tb8:1;uint8_tb9:1;uint8_tb10:1;uint8_tb11:1;uint8_tb12:1;uint8_tb13:1;uint8_tb14:1;uint8_tb15:1;}bits;uint16_tbytes;};unionSFLAGSflag={0};现在想设置b0位的值,该如何写代码,试用Sflag.bytes&=0x01;怎么不对呢???请高手帮助解决,谢谢!!

    ni IO AG ui 技术交流 单片机

    2024-05-05 2