第1个回答 2015-07-01
温度的最大范围和精度是多少?
时间是连续的,没必要每条信息都记录时间,只要记录开始的时间和已经记录的温度个数就可以了。
假设温度用short int(-32768~32767)表示-327.68~327.67度,这样每个温度就要2byte
short temp[24*60];
24x60=1440个温度,1440x2=2880byte ,2k多
记录开始时间
#pragma pack(1)
struct time {
unsigned short year; //2byte
unsigned char month //1byte
unsigned char day //1byte
unsigned char hour //1byte
unsigned char minute //1byte
} start_time;
#pragma pack()
2+1+1+1+1=6byte
已经记录的温度个数
unsigned short temp_count =0; //2btye
总打小:2880+6+2=2888 byte