b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
OverCloud (天马行空) 于 (Tue Mar 27 16:55:30 2007) 提到:
用的os没有itoa. 只好自己写了一个.
char * itoa(unsigned i, char *str, int redex)
{
static const char *LOOKUP = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char holder;
char *p1, *p2;
if(redex > 0 && redex < sizeof(LOOKUP)/sizeof(char))
{
if (i == 0)
{
str[0] = '0';
str[1] = '\0';
}
else
{
p1 = str;
|
|