c语言 结构体 、数组的使用,定义的同时必须初始化,否者它们成员的数值会错乱,不是想象的样子
数组
unsigned char password[8]={'0','1','2','3','4','5','6','7'};
结构体
typedef struct
{
unsigned char adjust_temperature_change;
unsigned char lock_flag;
unsigned char ctrl_Model;
unsigned char device_status;
unsigned char set_lower_temperature;
unsigned char set_upper_temperature;
unsigned char legal_user_num;
}Device_info;
Device_info device_info={0,1,0,0,20,25,0};
|