转换函数之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; }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/179363.html原文链接:https://javaforall.net
