/*
* 整型转字符串
*/
83 void itoa(int i, char *string)
84 {
85 int power = 0;
86 int j = 0;
87
88 j = i;
89
90 for (power=1; j>=10; j/=10) {
91 power *= 10;
92 }
93
94 for (; power>0; power/=10) {
95 *string++ = '0'+ i/power;
96 i %= power;
97 }
98
99 *string = '\0';
100 }
linux下 整型转字符串函数
最新推荐文章于 2022-09-21 22:04:59 发布