最直接的方式,數(shù)字使用ASCii碼。
uchar dat[]={"溫度:23.00"};
改數(shù)據(jù)的時候,直接修改dat數(shù)組的成員,以下標方式,比如改溫度為26.33,
dat[6]='2';// 或者dat[6]=0x30+2; 這個2是整數(shù)值.0x30=48,對應于ascii碼的'0',50對應ascii碼的'2'
dat[7]='6';// 或者dat[7]=0x30+6; 這個2是整數(shù)值
dat[8]='.';
dat[9]='3';
dat[10]='3'; |