//keil中默认是不支持匿名结构体的,需要编译指令#pragma anon_unions指名。

#pragma anon_unions  
typedef union {  
        unsigned int num;  
        struct {  
                unsigned int nLow        :8;  
                unsigned int nHigh         :8;  
        };  
} Test;  
  
void func(void)  
{  
    Test test;  
    test.num=99;  
    test.nLow=10;  
}

相关文章:

  • 2021-06-15
  • 2022-01-01
  • 2021-07-05
  • 2021-10-15
  • 2021-05-30
  • 2021-12-23
猜你喜欢
  • 2021-05-25
  • 2021-06-25
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案