typedefunsignedcharBYTE;
BYTE*ByteToStr(BYTEn)
BYTEstr[4];
BYTE*pStr;
pStr=str;
if(n>99)
*pStr=n/100;
n%=100;
*pStr+='0';
pStr++;
*pStr=n/10;
n%=10;
*pStr+='0';
pStr++;
if(n>9)
*pStr=n/10;
n%=10;
*pStr+='0';
pStr++;
if(n<10)
*pStr=n+'0';
pStr++;
*pStr=0;
returnstr;
用了5Byte內(nèi)存,不知是否精簡,先用著再說!String轉(zhuǎn)unsignedchar的要反過來先減'0'再乘,不過要檢查是否小于等于255。等寫好了再放上來.