转换函数之uitoa
/* 实现uitoa函数的源代码 */
char * _uitoa(unsigned int num,char *str)
{
unsigned char i=0,index=0;
unsigned char temp=0;
unsigned int bottom=10000;
for(i=0;i<5;i++)
{
temp=num/bottom;
if(temp>0 || index>0) str[index++]=0x30+temp;
num%=bottom;
bottom/=10;
}
if(index==0)
str[index++]=0x30;
str[index]='\0';
return str;
}