#include <stdlib.h> typedef unsigned char uint8_t; union wate_temp{ struct { uint8_t wate_temp_low :1; uint8_t wate_temp_high :4; uint8_t reverse :3; } wate_temp_T; uint8_t wate_temp; }; int main() { union wate_temp wate_temp_u; wate_temp_u.wate_temp_T.wate_temp_high=7; wate_temp_u.wate_temp_T.wate_temp_low=1; printf("wate_temp=%d\n",wate_temp_u.wate_temp); wate_temp_u.wate_temp = 20; printf("wate_temp_high=%d\n", wate_temp_u.wate_temp_T.wate_temp_high); printf("wate_temp_low=%d\n",wate_temp_u.wate_temp_T.wate_temp_low); return(0); }